473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Allowed or not?

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.
Jul 19 '05 #1
1 1520

"Kleuske" <t-******@achter.de.del> schreef in bericht
news:3f***********************@news.xs4all.nl...
<snip>
Question: Is this OK? Compiler dependent? Dead wrong?


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

See

http://www.lns.cornell.edu/public/CO...p_1.html#SEC32

http://www.eskimo.com/~scs/C-faq/q10.13.html

Bye...
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Greg Scharlemann | last post by:
I have set up Apache Axis with a Resin server. Everything seems to be set up correctly, axis will validate if I display the http://axis.scharlemann.com/axis/happyaxis.jsp file. However when I...
1
by: qwejohn | last post by:
Hello, I had posted this question in the twisted mailing list but did not got a solution ; I hope that the python Gurus of this forum can help me a bit. I am trying the exmaple in the python...
2
by: Alex Vinokur | last post by:
========================================= Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) ========================================= Here is some program...
1
by: Anandan | last post by:
Hi, This is regarding Dataset Filter: WILDCARD CHARACTERS Both the * and % can be used interchangeably for wildcards in a LIKE comparison. If the string in a LIKE clause contains a * or %,...
8
by: Larry Lard | last post by:
Today I discovered that a syntax that I thought was forbidden in C# but allowed in VB.NET (and I _don't like_ that it's allowed in VB.NET) is actually allowed in C#. Which confused me. The syntax...
2
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
9
by: haijin.biz | last post by:
I tried the following code and found that the form #include <iostream> using namespace std; int main(int argc, char** argv) { //int a; // error C2466: cannot allocate an array of constant...
1
by: Markus | last post by:
Hi My ISP seems to have made a PHP version upgrade - without any change in the code, a new error occurs: PHP Warning: ftp_nlist() : open_basedir restriction in effect. File(/var/tmp/) is not...
9
by: Abandoned | last post by:
Hi.. I want to delete all now allowed characters in my text. I use this function: def clear(s1=""): if s1: allowed = s1 = "".join(ch for ch in s1 if ch in allowed) return s1
41
by: dspfun | last post by:
Hi! Are suffixes allowed on expressions? For example, is the following allowed: #define SECONDS_PER_YEAR (60 * 60 * 365) UL I found this in a C test at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.