K
Kleuske
Hi,
I have the following code, which works fine under Borland C++ and is refused
by GCC and a subsequent debate on whether or not it's OK. My vote is it's
*not*, since 'sizeof' is not known in the preprocessor.
<code>
#include <stdio.h>
/* checking the sie of a defined type */
#if (sizeof(unsigned long) != 4)
#error Nononononono...
#endif
int main(int argc, char* argv[])
{
printf("*** Yes\n");
return 0;
}
</code>
Question: Is this OK? Compiler dependent? Dead wrong?
Thanks in advance for your comments...
Regards,
Kleuske.
I have the following code, which works fine under Borland C++ and is refused
by GCC and a subsequent debate on whether or not it's OK. My vote is it's
*not*, since 'sizeof' is not known in the preprocessor.
<code>
#include <stdio.h>
/* checking the sie of a defined type */
#if (sizeof(unsigned long) != 4)
#error Nononononono...
#endif
int main(int argc, char* argv[])
{
printf("*** Yes\n");
return 0;
}
</code>
Question: Is this OK? Compiler dependent? Dead wrong?
Thanks in advance for your comments...
Regards,
Kleuske.