N
Nick Keighley
Nick Keighley wrote:
sizeof(*channel) doesn't derefer channel, the same way that sizeof(x)
doesn't read the value of x.
yes I know. Your point being?
Nick Keighley wrote:
sizeof(*channel) doesn't derefer channel, the same way that sizeof(x)
doesn't read the value of x.
Kaz said:Yes, they are punctuators. See 6.4.6. They serve a similar role to commas,
semicolons, parentheses and the like.
Speaking of which, the ( ) in the while statement are punctuators also.
See, we have names for everything.
Joe said:I stand corrected. "There is no object of void type." How's that?
Joe Wright said:Fascinating.
#include <stdio.h>
int main(void) {
printf("%d\n", (int)sizeof (void));
return 0;
}
DJGPP and MinGW (gcc) quietly prints 1.
cl (Microsoft C) warns that 'sizeof returns 0' but compiles and prints 0.
Pelles C says it's an error and refuses to compile it.
Microsoft gets it right. I just saw a flying pig.
(e-mail address removed) (Richard Harter) writes:
[...][...]BTW if the, ah, operand might be a macro consider using
parentheses as a prophylactic.
If the operand is a macro, and the macro is defined in such a way that
parentheses are necessary, *fix the macro definition*.
I'd use prophylactic parentheses only if I *knew* that the particular
macro were poorly defined and I was unable to fix it.
That sounds rather odd. You have a choice of two idioms, (a)
enclose the operand in parentheses or (b) omit the parentheses.
Idiom (a) is more robust. You insist on using idiom (b) to the
point of changing existing working code elsewhere rather than
using the more robust idiom (a). This doesn't sound like good
practice to me.
Joe Wright said:Fascinating.
#include <stdio.h>
int main(void) {
printf("%d\n", (int)sizeof (void));
return 0;
}
DJGPP and MinGW (gcc) quietly prints 1.
cl (Microsoft C) warns that 'sizeof returns 0' but compiles and prints 0.
Pelles C says it's an error and refuses to compile it.
Microsoft gets it right. I just saw a flying pig.
Joe said:Fascinating.
#include <stdio.h>
int main(void) {
printf("%d\n", (int)sizeof (void));
return 0;
}
DJGPP and MinGW (gcc) quietly prints 1.
cl (Microsoft C) warns that 'sizeof returns 0' but compiles and prints 0.
Pelles C says it's an error and refuses to compile it.
Microsoft gets it right. I just saw a flying pig.
Keith said:Joe Wright said:[...]
Microsoft gets it right. I just saw a flying pig.
No, Microsoft gets it wrong; only Pelles C gets it right.
[...]
In fact, both "gcc -pedantic" and Microsoft C are conforming with
respect to this case; ``sizeof (void)'' is a constraint violation,
and both issue a diagnostic. The fact that it's a warning rather
than a fatal error is irrelevant as far as conformance is concerned,
as is the fact that Microsoft C's warning includes the silly claim
that "sizeof returns 0". (Perhaps MS C behaves more sensibly with
the right options.)
Richard Heathfield said:I must disagree. Since minutiae are measuriae of arc, and tangents are
straight lines, "tangential minutiae" is a contradiction in terms.
Therefore, one cannot seize on tangential minutiae.
Eric Sosman said:Keith said:Joe Wright said:[...]
Microsoft gets it right. I just saw a flying pig.
No, Microsoft gets it wrong; only Pelles C gets it right.
[...]
In fact, both "gcc -pedantic" and Microsoft C are conforming with
respect to this case; ``sizeof (void)'' is a constraint violation,
and both issue a diagnostic. The fact that it's a warning rather
than a fatal error is irrelevant as far as conformance is concerned,
as is the fact that Microsoft C's warning includes the silly claim
that "sizeof returns 0". (Perhaps MS C behaves more sensibly with
the right options.)
Why do you describe conforming behavior as "wrong?"
Kaz said:How about linkage; didn't anyhone ever notice what libraries are being
linked to the code? Did their toolchain not have a separate C++ library
for C++ programs?
Keith Thompson said:Is there also a mechanism (say, a new macro in <limits.h>) to query
the maximum alignment for any type, so mere mortals can write
malloc()-like functions?
Seebs said:I just have to know: Was that a Thursday afternoon decision?
Nick Keighley said:doesn't offsetof() qualify as reflective? It needs compiler magic.
No. And Thursdays aren't nearly as notorious as they used to be.
Phil Carmody said:Yes, Gnus fails to flow the content correctly. File a bug!
Works for me.
Keith Thompson said:(What I found odd was the combination of "charset=UTF-8" and "7bit".
Perhaps the newsreader would change it to "8bit" if the article
contained any non-7bit characters.)
Kaz Kylheku said:Have you checked all of the normative references? Maybe ISO 2382-1 has
a definition for operator. I don't have this document.
The term ``local variable'' also cannot be found in the standard.
Good luck convincing the world to say ``object with automatic storage
duration''.
The standard does use the term ``local'' in several places without really
defining what it means. The term ``variable'' (as a noun) also appears in
normative text, but it is not defined.
First occurence: 6.8.5.3 The for statement.
``If clause-1 is a declaration, the scope of any variables it declares
is the remainder of the declaration and the entire loop, including the
other two expressions; it is reached in the order of execution before
the first evaluation of the controlling expression.''
Maybe it's found in ISO 2382-1.
Kaz said:Have you checked all of the normative references? Maybe ISO 2382-1 has
a definition for operator. I don't have this document.
The term ``local variable'' also cannot be found in the standard.
[...]
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.