L
Linny
Hi,
I have picked this piece of code(slightly modified) from one of gimpel
software's lint page "bug of the month"
#include <stdio.h>
#define ON_THE_ROCKS
const char *ice()
{
#if defined(SHAKEN_NOT_STIRRED)
return "shaken not stirred";
#elif defined(STIRRED_NOT_SHAKEN)
return "stirred not shaken";
#elif defined(ON_THE_ROCKS)
return "on the rocks";
#else
return "";
#endif
}
int main()
{
int i;
printf( "Celebrate the New Year " );
printf( "with your drink %s.\n", ice() );
return 0;
}
The output after compiling with gcc(Dev C++) and execution was
"Celebrate the New Year with your drink ." and not "Celebrate the New
Year with your drink on the rocks" as I expected.
The Reference Manual Explanation given was
750 local macro 'Symbol' (Location) not referenced -- A 'local'
macro is one that is not defined in a header file. The macro
was
not referenced throughout the module in which it is defined.
I am unable to follow the explanation as I tried including the macro in
a header file but got the same result. Am I missing something ? Can
anyone please explain in detail.
I have picked this piece of code(slightly modified) from one of gimpel
software's lint page "bug of the month"
#include <stdio.h>
#define ON_THE_ROCKS
const char *ice()
{
#if defined(SHAKEN_NOT_STIRRED)
return "shaken not stirred";
#elif defined(STIRRED_NOT_SHAKEN)
return "stirred not shaken";
#elif defined(ON_THE_ROCKS)
return "on the rocks";
#else
return "";
#endif
}
int main()
{
int i;
printf( "Celebrate the New Year " );
printf( "with your drink %s.\n", ice() );
return 0;
}
The output after compiling with gcc(Dev C++) and execution was
"Celebrate the New Year with your drink ." and not "Celebrate the New
Year with your drink on the rocks" as I expected.
The Reference Manual Explanation given was
750 local macro 'Symbol' (Location) not referenced -- A 'local'
macro is one that is not defined in a header file. The macro
was
not referenced throughout the module in which it is defined.
I am unable to follow the explanation as I tried including the macro in
a header file but got the same result. Am I missing something ? Can
anyone please explain in detail.