By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Allowed or not?

P: n/a

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.

#include <stdio.h>

/* checking the sie of a defined type */
#if (sizeof(unsigned long) != 4)
#error Nononononono...

int main(int argc, char* argv[])
printf("*** Yes\n");
return 0;

Question: Is this OK? Compiler dependent? Dead wrong?

Thanks in advance for your comments...


Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

"Kleuske" <t-******> schreef in bericht
Question: Is this OK? Compiler dependent? Dead wrong?

Ok I was right. It's *not* OK.


Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.