Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > is this compiler diagnostic legal?

Thread Tools

is this compiler diagnostic legal?

Thad Smith
Posts: n/a
Robert Gamble wrote:

> %X does always require an unsigned type, %lX requires a type of
> unsigned long which you properly provided.

That is what I expect, but the Standard is amazingly ambiguous:, p7:
The length modifiers and their meanings are:
l (ell) Specifies that a following d, i, o, u, x, or X conversion specifier
applies to a long int or unsigned long int argument; ...

Whose choice is it whether it should be long int or unsigned long int?

Then p8:
The conversion specifiers and their meanings are:
o,u,x,X The unsigned int argument is converted to unsigned octal (o),
unsigned decimal (u), or unsigned hexadecimal notation (x or X) in the
style dddd; ...

Here the X specifier says that it requires an unsigned int argument with no
mention of an alternative, no mention of arument type for %lX, so someone
has to choose whether the argument is an long int or unsigned long int and
on what basis?

This is a where I think I know the intent, but have a hard time proving it
with the wording in the Standard.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
INT_MIN and compiler diagnostic C Programming 41 03-26-2007 03:47 AM
Got one compiler diagnostic I can't handle Richard Lionheart C++ 2 03-22-2006 02:21 PM
Diagnostic IPSec-related IOS command VectorX Cisco 0 10-04-2005 10:14 AM
Wireless Network Diagnostic Tools Charles Law Wireless Networking 5 09-16-2004 02:57 PM
Cisco 2950 vs 3Com 4400 - Troubleshooting and Diagnostic options Siddhartha Jain Cisco 2 04-28-2004 12:59 AM