gcc -W -Wall -O -pedantic -std=c99 vs clang with same options

Trying to output a pointer's address in decimal form using the %zu conversion specifier. Runs okay as expected except that gcc warns 'format ‘%zu’ expects type ‘size_t’, but argument 4 has type ‘long int *’. gcc options used are shown in the question. gcc still warns without any options set (other than -std=c99). clang however, does not issue any warnings at all with the same options. This is on OS X 10.7. Just curious why clang isn't issuing any warnings? Is gcc "better" than clang for debugging/compiling?

Answers


This appears to be specific to the z size modifier in clang; you do get a warning with %lu, %u, %hu, etc. (Even without any options)

Generally speaking, it has been my experience that clang has more useful warning messages than GCC does. This is an exception to that experience. I'll file a bug.


Need Your Help

Session loss analysis

c# .net asp.net session session-state

our web application frequently losses it's session state (user is being logged out very often). I predict that the reason of such behavior are some exceptions thrown and unhandled in side threads of

Does not skip to main activity

android android-intent android-activity android-preferences splash-screen

Hi all I am using a splash activity for first time or he is logged out from my app. But this appear frequently on Samsung galaxy S2. This my activity onCreate() method code