Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
Thanks !
tsuyoshi 127 5068 bz****@hotmail.com wrote:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
No. Neither is it valid C99. You can't put a statement block within an
expression context. bz****@hotmail.com said:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
No. The right operand of an assignment-operator must (eventually) be an
expression that yields a value. A compound statement does not yield a
value.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
On Mar 10, 2:06 pm, "santosh" <santosh....@gmail.comwrote:
bz8...@hotmail.com wrote:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
No. Neither is it valid C99. You can't put a statement block within an
expression context.
Even I did think that its against Ansi C standards as compound
statements dont yield any value. But when I compile it it compiles
well and executes to give a result of 4.
I am using Dev-CPP compiler and I am using Windows OS.I'm surprised to
find that not even warnings are generated though I expected an error.
Is it a bug with the compiler?
SRR wrote:
On Mar 10, 2:06 pm, "santosh" <santosh....@gmail.comwrote:
bz8...@hotmail.com wrote:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
No. Neither is it valid C99. You can't put a statement block within an
expression context.
Even I did think that its against Ansi C standards as compound
statements dont yield any value. But when I compile it it compiles
well and executes to give a result of 4.
I am using Dev-CPP compiler and I am using Windows OS.I'm surprised to
find that not even warnings are generated though I expected an error.
Is it a bug with the compiler?
It is not a bug with the compiler. GCC (which is used by Dev-CPP) is
not a conforming compiler for any standardised language unless
specific options are passed to it; at the minimum, to get a C
compiler, use the -ansi (or -std=c89) and -pedantic (or -pedantic-
errors) options. bz****@hotmail.com writes:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
Thanks !
tsuyoshi
I think this is invalid for ANSI C, since ANSI C require each
declaration for variable to be in place before all execution
statement.
But however it will work on, compiled by gcc. But if you try
Microsoft's compiler, it won't work, since they have no interest to
implement the new C99 syntax.
The compiler did not give any warning or error it is because the
compiler suppose such syntax, namely, declaration after the execution
code. For instance
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
in ANSI C it should be;
int i;
/* some other code perhaps */
for( i = 0; i < count; i++ )
The reason that your code give the result a = 4 is below:
when C find the assignment "=", it require its right operand to return
a value, and assign this value to the left operand.
In this case it find a block, "{...}". It will execute this block of
code and get the value by this execution. Every assignment will return
a value, which is the value it assigned to its left operand. So after
c = a + 2;
been executed, the first "=" get the value returned by "c = a + 2",
namely, 4. This is what you got.
To illustrate this more clearly, see below:
#include <dirent.h>
/* some codes */
DIR *dp;
if( ( d = opendir( argv[ 1 ])) == NULL )
/* other codes */
This will work though the left operand of "==" is an assignment
statement, not a variable or constant. Because
d = opendir( argv[ 1 ])
will return the value of
opendir( argv[ 1 ] )
On Mar 10, 5:37 pm, Zhou <zhouyan1...@gmail.comwrote:
bz8...@hotmail.com writes:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
Thanks !
tsuyoshi
I think this is invalid for ANSI C, since ANSI C require each
declaration for variable to be in place before all execution
statement.
But however it will work on, compiled by gcc. But if you try
Microsoft's compiler, it won't work, since they have no interest to
implement the new C99 syntax.
The compiler did not give any warning or error it is because the
compiler suppose such syntax, namely, declaration after the execution
code. For instance
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
in ANSI C it should be;
int i;
/* some other code perhaps */
for( i = 0; i < count; i++ )
The reason that your code give the result a = 4 is below:
when C find the assignment "=", it require its right operand to return
a value, and assign this value to the left operand.
In this case it find a block, "{...}". It will execute this block of
code and get the value by this execution. Every assignment will return
a value, which is the value it assigned to its left operand. So after
c = a + 2;
been executed, the first "=" get the value returned by "c = a + 2",
namely, 4. This is what you got.
This explanation will not be correct in this respect.
In C assignment is an expression and therefore evaluate to the
assigned value.
But statements are not expressions!!
In the code given in the question, a compound statement is enclosed
within paranthesis and is "assigned" to an int variable!
Note that a statement is just a statement and does not yield any
value!!
>
To illustrate this more clearly, see below:
#include <dirent.h>
/* some codes */
DIR *dp;
if( ( d = opendir( argv[ 1 ])) == NULL )
/* other codes */
This will work though the left operand of "==" is an assignment
statement, not a variable or constant. Because
d = opendir( argv[ 1 ])
will return the value of
opendir( argv[ 1 ] )- Hide quoted text -
- Show quoted text -
SRR wrote:
On Mar 10, 2:06 pm, "santosh" <santosh....@gmail.comwrote:
bz8...@hotmail.com wrote:
Hi
Does this code satisfy ANSI C syntax ?
void function(void)
{
int a = 2;
a = ({int c; c = a + 2;}); /* <<-- here !! */
printf("a=%d\n", a);
}
No. Neither is it valid C99. You can't put a statement block within an
expression context.
Even I did think that its against Ansi C standards as compound
statements dont yield any value. But when I compile it it compiles
well and executes to give a result of 4.
I am using Dev-CPP compiler and I am using Windows OS.I'm surprised to
find that not even warnings are generated though I expected an error.
Is it a bug with the compiler?
No. gcc, unless otherwise instructed, compiles it's own C-like
language, called GNU C. GNU C provides numerous extensions over ISO C,
and is far more forgiving of less than correct constructs. To compile
your code with strict conformance to C90, use the -ansi and -pedantic
flags. For partial conformance to C99, use -std=c99 and -pedantic. It
also helps to set diagnostic output to a reasonable level with -Wall
and -Wextra at a minimum.
Consult the gcc reference, either an online info page, or at the gcc
website, for all the details for harnessing gcc. It's a powerful
compiler and it's options are well worth a detailed study. It'll
really help you get the most out of your compilation process.
Zhou wrote:
>
.... snip ...
>
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com
CBFalconer <cb********@yahoo.comwrites:
Zhou wrote:
>>
... snip ...
>> for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc think it is OK.
C99 is ANSI C. You mean not valid for C90.
ANSI C is referred to C89.
In 1989 ANSI published the first C standard.
In 1990 ISO adopt this C89 as ISO 9899:1990, so called C90
In 1999 ISO published the ISO 9899:1999, so called C99
ANSI only published C89 and C99 is ISO C.
When reffered to ANSI C we always refer to C89 or equivalent, C90.
For instance, in GCC, -ansi is the same as -std=c89 option.
The last thing...we should not discuss the Standard in this
newsgroup...
CBFalconer wrote:
Zhou wrote:
... snip ...
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
Erm, isn't ANSI C synonymous with C90?
santosh said:
>
CBFalconer wrote:
>Zhou wrote:
>
... snip ...
>
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
Erm, isn't ANSI C synonymous with C90?
Not any more. C89 and ANSI C were once synonymous, and C90 and ISO C
were once synonymous. But C99 is the current C Standard as far as both
ANSI and ISO are concerned.
(And C90 is the current C Standard as far as almost everyone else is
concerned.)
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Zhou Yan wrote:
CBFalconer <cb********@yahoo.comwrites:
Zhou wrote:
>
... snip ...
>
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
<snip>
The last thing...we should not discuss the Standard in this
newsgroup...
Wherever did you get that wild idea from?
We *do* discuss the C Standards in this group. In fact, that's the
only thing we discuss :-)
Richard Heathfield wrote:
santosh said:
CBFalconer wrote:
Zhou wrote:
... snip ...
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
Erm, isn't ANSI C synonymous with C90?
Not any more. C89 and ANSI C were once synonymous, and C90 and ISO C
were once synonymous. But C99 is the current C Standard as far as both
ANSI and ISO are concerned.
So ANSI adopted ISO's C99 version of the Standard?
Thanks for clearing up that confusion.
<snip>
santosh said:
Zhou Yan wrote:
<snip>
>
>The last thing...we should not discuss the Standard in this newsgroup...
Wherever did you get that wild idea from?
What's so wild about it? He's right.
We *do* discuss the C Standards in this group. In fact, that's the
only thing we discuss :-)
No. The C Standard is discussed in comp.std.c. Here, we discuss
programming in C. The C Standard defines C, which is why it crops up so
much here, but the topic of the comp.lang.c group is the /usage/ of the
language, not its definition.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
santosh said:
Richard Heathfield wrote:
<snip>
>But C99 is the current C Standard as far as both ANSI and ISO are concerned.
So ANSI adopted ISO's C99 version of the Standard?
Yes. It took them a little while, but they finally adopted it some time
in April or May 2000. I can't quite recall what took them so long -
probably something as silly as only one of them having a pen with which
to sign the relevant paperwork, and he was ill on the day of the
meeting. Or perhaps the dog ate their courtesy copy of C99 and they had
to beg ISO for a new one. I don't know.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Thank you for everyone.
I understood that it was GCC expansion.
tsuyoshi
On Sat, 10 Mar 2007 22:55:19 +0800, in comp.lang.c , Zhou Yan
<zh*********@gmail.comwrote:
>CBFalconer <cb********@yahoo.comwrites:
>Zhou wrote:
>>>
... snip ...
>>> for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc think it is OK.
C99 is ANSI C. You mean not valid for C90.
ANSI C is referred to C89.
No. ANSI also ratified C99, and copies of the standard distributed in
the US bear the ANSI logo. Indeed folk round here would mostly
understand ANSI C and ISO C to be synonyms, especially in a USAnian
context.
>When reffered to ANSI C we always refer to C89 or equivalent, C90.
No.
>For instance, in GCC, -ansi is the same as -std=c89 option.
Mayve, but thats a gcc-ism not a C feature.
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
"SRR" <SR**********@gmail.comwrites:
This explanation will not be correct in this respect.
In C assignment is an expression and therefore evaluate to the
assigned value.
But statements are not expressions!!
In the code given in the question, a compound statement is enclosed
within paranthesis and is "assigned" to an int variable!
Note that a statement is just a statement and does not yield any
value!!
So, I see that I am wrong...but could you please kindly explain why
that code will produce the out put "a = 4", I managed to compile that
code fragment and really got "a = 4", which make me think about that
the right oprand {...} yield a value 2.
If it is just
a = ( c = 4 );
that is clearly what happend. But does that code
a = ( { int c; c = 2 + a; } );
also give us a = 4?
Thanks
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is "American".
If we're going to be pummeling the non-native speakers for using silly
abbreviations, then we ought to refrain from doing the same ourselves.
Brian
Default User said:
Mark McIntyre wrote:
>especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is "American".
Some people think it logical to reserve the term "American" for
describing (things pertaining to) the continents of North and South
America, just as "European" describes things pertaining to Europe,
"African" describes things pertaining to Africa, and so on. Such people
think it pretty silly to use the term "American" to describe only
things pertaining to a country that occupies a mere quarter of the
Americas. It would be as silly as using the word "Asians" to describe
*only* the Chinese.
If we're going to be pummeling the non-native speakers for using silly
abbreviations, then we ought to refrain from doing the same ourselves.
"Usanian" isn't an abbreviation. It's a coined word that has
considerable mind-share behind it.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
On 10 Mar 2007 20:54:21 GMT, in comp.lang.c , "Default User"
<de***********@yahoo.comwrote:
>Mark McIntyre wrote:
>especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is "American".
American technically refers to anyone living in the Americas, not just
those living in the USA. Don't blame me if the imperialist running
dogs stole the name of an entire two continents... :-)
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
santosh wrote:
CBFalconer wrote:
>Zhou wrote:
... snip ...
>>> for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc think it is OK.
C99 is ANSI C. You mean not valid for C90.
Erm, isn't ANSI C synonymous with C90?
No. ANSI C refers to the standard approved by ANSI, which
currently is C99.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com
Default User wrote:
Mark McIntyre wrote:
>especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is "American".
If we're going to be pummeling the non-native speakers for using silly
abbreviations, then we ought to refrain from doing the same ourselves.
Firmly disagree. American includes Canadian, Mexican, Brazilian,
Argentinian, Columbian, Costa Rican, etc. I believe in Canada the
appropriate standards organization is CSO. As long as we require
precision in code, we should also require precision in associated
verbiage, even if it requires coining a word.
The USA occupies considerably less than 1/2 of the North American
continent, not to mention all of North, South, and Central America.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com
CBFalconer <cb********@yahoo.comwrites:
santosh wrote:
>CBFalconer wrote:
>>Zhou wrote:
... snip ...
for( int i = 0; i < count; i++ )
the code above is not valid for ANSI C but valid for C99, and gcc think it is OK.
C99 is ANSI C. You mean not valid for C90.
Erm, isn't ANSI C synonymous with C90?
No. ANSI C refers to the standard approved by ANSI, which
currently is C99.
Yes, but it's still very common to refer to C89/C90 as "ANSI C".
Incorrect, but common.
Personally, I avoid using the term "ANSI C". I refer to "ISO C" if
it's sufficiently clear from the context whether I'm talking about C90
or C99, and "C90" or "C99" (or rarely "C95") to refer to the language
defined by a particular version of the standard.
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Richard Heathfield wrote:
Default User said:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American".
Some people think it logical to reserve the term "American" for
describing (things pertaining to) the continents of North and South
America, just as "European" describes things pertaining to Europe,
"African" describes things pertaining to Africa, and so on.
Which is silly. There is no continent of "America". There is North
America, the denizens and things pertaining proper called "North
American", and South America, likewise "South American".
"Usanian" isn't an abbreviation. It's a coined word that has
considerable mind-share behind it.
Only by people who wish to insult and annoy Americans.
Brian
CBFalconer wrote:
Default User wrote:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American". If we're going to be pummeling the non-native speakers
for using silly abbreviations, then we ought to refrain from doing
the same ourselves.
Firmly disagree. American includes Canadian, Mexican, Brazilian,
Argentinian, Columbian, Costa Rican, etc.
It can in certain contexts, but all dictionaries firmly list the
"resident of the USA". American is not used to describe the citizens of
any other nation. Period.
Many Americans consider it HIGHLY insulting to use such neologisms in
place of the proper name.
Brian
Mark McIntyre wrote:
On 10 Mar 2007 20:54:21 GMT, in comp.lang.c , "Default User"
<de***********@yahoo.comwrote:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American".
American technically refers to anyone living in the Americas, not just
those living in the USA.
Provide some evidence of such use. I'll bet you have one hell of a hard
time. It's an insult to Americans to rob us of our correct name.
Brian
Default User said:
Richard Heathfield wrote:
>Default User said:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American".
Some people think it logical to reserve the term "American" for describing (things pertaining to) the continents of North and South America, just as "European" describes things pertaining to Europe, "African" describes things pertaining to Africa, and so on.
Which is silly. There is no continent of "America".
Neither is there a country called "America". And your point?
There is North
America, the denizens and things pertaining proper called "North
American", and South America, likewise "South American".
>"Usanian" isn't an abbreviation. It's a coined word that has considerable mind-share behind it.
Only by people who wish to insult and annoy Americans.
Not so. Rather, the term "American" was hijacked for self-description by
a group that constitutes less than a third of the population of the two
American continents. The term "Usanian" is merely an attempt to
facilitate an un-hijacking of that term. If anything is insulting to
Americans, it is the suggestion that the majority of them don't count
as American, simply because they are not from the United States.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Default User said:
CBFalconer wrote:
>Default User wrote:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American". If we're going to be pummeling the non-native speakers
for using silly abbreviations, then we ought to refrain from doing
the same ourselves.
Firmly disagree. American includes Canadian, Mexican, Brazilian, Argentinian, Columbian, Costa Rican, etc.
It can in certain contexts, but all dictionaries firmly list the
"resident of the USA".
That is certainly true. After all, dictionaries describe usage, and
there is no doubt that a great many Usanians use the term "American" to
describe themselves.
American is not used to describe the citizens of any other nation.
But that is certainly false. I use it in that way myself, so I am a
counter-example. Other counter-examples exist.
Many Americans consider it HIGHLY insulting to use such neologisms in
place of the proper name.
Which Americans do you mean? Argentinians? Bolivians? Brazilians?
Colombians? Canadians? Guatemalans? Mexicans? Panamanians? Paraguayans?
Peruvians? Uruguayans? Usanians? Venezuelans? (Non-exhaustive list.)
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Default User said:
Mark McIntyre wrote:
>On 10 Mar 2007 20:54:21 GMT, in comp.lang.c , "Default User" <de***********@yahoo.comwrote:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American".
American technically refers to anyone living in the Americas, not just those living in the USA.
Provide some evidence of such use.
I use it in that way, so I am a supporting example for Mark's claim.
I'll bet you have one hell of a hard time.
Nah, it was easy.
It's an insult to Americans to rob us of our correct name.
On the contrary, the claim that "Americans" only applies to Usanians is
an insult to all the other Americans.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Richard Heathfield wrote:
Default User said:
>CBFalconer wrote:
>>Default User wrote: Mark McIntyre wrote:
especially in a USAnian ^^^^^^^
The above is not a word. The term you're searching for is "American". If we're going to be pummeling the non-native speakers for using silly abbreviations, then we ought to refrain from doing the same ourselves. Firmly disagree. American includes Canadian, Mexican, Brazilian, Argentinian, Columbian, Costa Rican, etc.
It can in certain contexts, but all dictionaries firmly list the "resident of the USA".
That is certainly true. After all, dictionaries describe usage, and
there is no doubt that a great many Usanians use the term "American" to
describe themselves.
>American is not used to describe the citizens of any other nation.
But that is certainly false. I use it in that way myself, so I am a
counter-example. Other counter-examples exist.
"Apple" is used to describe oranges. It's certainly true, here's
the proof: orange is an apple, apple is an orange. We love logic,
it's such a powerful tool in conversations, don't we?
>Many Americans consider it HIGHLY insulting to use such neologisms in place of the proper name.
Which Americans do you mean? Argentinians? Bolivians? Brazilians?
Colombians? Canadians? Guatemalans? Mexicans? Panamanians? Paraguayans?
Peruvians? Uruguayans? Usanians? Venezuelans? (Non-exhaustive list.)
Did you ask these people if they are Americans and if they find it
insulting when someone calls them Americans?
Anyway, I am not an American nor a Great-Britaininan, so I guess I
miss very important details about this argument.
Yevgen
"Default User" <de***********@yahoo.comwrites:
CBFalconer wrote:
>Default User wrote:
Mark McIntyre wrote:
especially in a USAnian
^^^^^^^
The above is not a word. The term you're searching for is
"American". If we're going to be pummeling the non-native speakers
for using silly abbreviations, then we ought to refrain from doing
the same ourselves.
Firmly disagree. American includes Canadian, Mexican, Brazilian, Argentinian, Columbian, Costa Rican, etc.
It can in certain contexts, but all dictionaries firmly list the
"resident of the USA". American is not used to describe the citizens of
any other nation. Period.
Many Americans consider it HIGHLY insulting to use such neologisms in
place of the proper name.
Speaking as an American, it doesn't bother me at all. I understand
that "American" is usually used to refer to a citizen of the US. I
also understand that excluding all the other residents of the American
continents is an bothersome to some as including them seems to be to
you.
This is entirely off-topic, and it's vanishingly unlikely that
anything is going to be resolved here. I suggest that both sides of
this debate quietly declare victory and move on.
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
"Richard Heathfield" <rj*@see.sig.invalidwrote in message
>
>It's an insult to Americans to rob us of our correct name.
On the contrary, the claim that "Americans" only applies to Usanians is
an insult to all the other Americans.
A Colombian friend of mine got very annoyed when I used the term "American"
to refer to the inhabitants of our former colonies. He said "I am an
American".
Unfortunately "Yank" is derogatory. "Usanian" is not a pronounceable word.
"Republicans" would be accurate but has been taken by a political party.
There just isn't a good word for our friends from over the pond.
--
Free games and programming goodies. http://www.personal.leeds.ac.uk/~bgy1mm
Richard Heathfield <rj*@see.sig.invalidwrote:
>Which Americans do you mean? Argentinians? Bolivians? Brazilians? Colombians? Canadians? Guatemalans? Mexicans? Panamanians? Paraguayans? Peruvians? Uruguayans? Usanians? Venezuelans? (Non-exhaustive list.)
This is exactly what I ask myself when all those angry people on TV
chant "Death to America". I mean, they could be talking about anybody!
-Beej
On Mar 11, 12:10 am, Zhou Yan <zhouyan1...@gmail.comwrote:
"SRR" <SRRajesh1...@gmail.comwrites:
This explanation will not be correct in this respect.
In C assignment is an expression and therefore evaluate to the
assigned value.
But statements are not expressions!!
In the code given in the question, a compound statement is enclosed
within paranthesis and is "assigned" to an int variable!
Note that a statement is just a statement and does not yield any
value!!
So, I see that I am wrong...but could you please kindly explain why
that code will produce the out put "a = 4", I managed to compile that
code fragment and really got "a = 4", which make me think about that
the right oprand {...} yield a value 2.
If it is just
a = ( c = 4 );
that is clearly what happend. But does that code
a = ( { int c; c = 2 + a; } );
also give us a = 4?
Thanks
I think that, the result is a consequence of the way the compiler
parses the tokens and compiles them.
You can't use the standards of C to explain the result you get because
I had already said a statement does not yield a vlaue as per its very
definition.
As per the C standards for the assignment there are following
constraints:
One of the following shall hold:94)
- the left operand has qualified or unqualified arithmetic type and
the right has
arithmetic type;
- the left operand has a qualified or unqualified version of a
structure or union type
compatible with the type of the right;
- both operands are pointers to qualified or unqualified versions of
compatible types,
and the type pointed to by the left has all the qualifiers of the type
pointed to by the
right;
- one operand is a pointer to an object or incomplete type and the
other is a pointer to a
qualified or unqualified version of void, and the type pointed to by
the left has all
the qualifiers of the type pointed to by the right;
- the left operand is a pointer and the right is a null pointer
constant; or
- the left operand has type _Bool and the right is a pointer.
Since none of the above constraints are satisfied by the given
statement, it is a constraint violation and you can't use C standards
to explain the result. I guess an error diagnostic is required by any
ANSI compiler, as the constraint is violated.
Correct me if I'm wrong.
Keith Thompson wrote:
"Default User" <de***********@yahoo.comwrites:
>CBFalconer wrote:
>>Default User wrote: Mark McIntyre wrote:
especially in a USAnian ^^^^^^^
The above is not a word. The term you're searching for is "American". If we're going to be pummeling the non-native speakers for using silly abbreviations, then we ought to refrain from doing the same ourselves.
Firmly disagree. American includes Canadian, Mexican, Brazilian, Argentinian, Columbian, Costa Rican, etc.
It can in certain contexts, but all dictionaries firmly list the "resident of the USA". American is not used to describe the citizens of any other nation. Period.
Many Americans consider it HIGHLY insulting to use such neologisms in place of the proper name.
Speaking as an American, it doesn't bother me at all. I understand
that "American" is usually used to refer to a citizen of the US. I
also understand that excluding all the other residents of the
American continents is an bothersome to some as including them
seems to be to you.
This is entirely off-topic, and it's vanishingly unlikely that
anything is going to be resolved here. I suggest that both sides
of this debate quietly declare victory and move on.
Hooray. We win. :-)
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
Richard Heathfield wrote:
Default User said:
>Mark McIntyre wrote:
>><de***********@yahoo.comwrote: Mark McIntyre wrote:
especially in a USAnian
The above is not a word. The term you're searching for is "American".
American technically refers to anyone living in the Americas, not just those living in the USA.
Provide some evidence of such use.
I use it in that way, so I am a supporting example for Mark's
claim.
>I'll bet you have one hell of a hard time.
Nah, it was easy.
>It's an insult to Americans to rob us of our correct name.
On the contrary, the claim that "Americans" only applies to
Usanians is an insult to all the other Americans.
Let us reason together. :-) The full name of the country is "The
United States of America". That intrinsically states that the US
is a subset of America. It is not even accurate, since Hawaii is
not a part of America.
BTW, I do not recall anyone other than "Default User" ever
complaining about "USAnian".
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
Malcolm McLean wrote:
>
.... snip ...
>
Unfortunately "Yank" is derogatory. "Usanian" is not a
pronounceable word. "Republicans" would be accurate but has been
taken by a political party. There just isn't a good word for our
friends from over the pond.
On the contrary, around here designating somewon as a Yankee is a
compliment. The point is that it is regional. Something like
calling all UKanians "Cockneys".
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
"Rajesh S R" <SR**********@gmail.comwrites:
On Mar 11, 12:10 am, Zhou Yan <zhouyan1...@gmail.comwrote:
[...]
>So, I see that I am wrong...but could you please kindly explain why that code will produce the out put "a = 4", I managed to compile that code fragment and really got "a = 4", which make me think about that the right oprand {...} yield a value 2. If it is just
a = ( c = 4 );
that is clearly what happend. But does that code
a = ( { int c; c = 2 + a; } );
also give us a = 4?
I think that, the result is a consequence of the way the compiler
parses the tokens and compiles them.
You can't use the standards of C to explain the result you get because
I had already said a statement does not yield a vlaue as per its very
definition.
Right.
As per the C standards for the assignment there are following
constraints:
One of the following shall hold:94)
- the left operand has qualified or unqualified arithmetic type and
the right has arithmetic type;
[snip]
Since none of the above constraints are satisfied by the given
statement, it is a constraint violation and you can't use C standards
to explain the result. I guess an error diagnostic is required by any
ANSI compiler, as the constraint is violated.
Correct me if I'm wrong.
The statement in question is a syntax error. A conforming compiler
that doesn't implement a gcc-like extension will never even have a
chance to check the constraints; the failure occurs earlier.
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Richard Heathfield wrote:
Default User said:
>Richard Heathfield wrote:
>>Default User said:
Mark McIntyre wrote:
especially in a USAnian ^^^^^^^
The above is not a word. The term you're searching for is "American". Some people think it logical to reserve the term "American" for describing (things pertaining to) the continents of North and South America, just as "European" describes things pertaining to Europe, "African" describes things pertaining to Africa, and so on.
Which is silly. There is no continent of "America".
Neither is there a country called "America". And your point?
>There is North America, the denizens and things pertaining proper called "North American", and South America, likewise "South American".
>>"Usanian" isn't an abbreviation. It's a coined word that has considerable mind-share behind it.
Only by people who wish to insult and annoy Americans.
Not so. Rather, the term "American" was hijacked for self-description by
a group that constitutes less than a third of the population of the two
American continents. The term "Usanian" is merely an attempt to
facilitate an un-hijacking of that term. If anything is insulting to
Americans, it is the suggestion that the majority of them don't count
as American, simply because they are not from the United States.
I think not. United States of America is over two hundred years old and
its citizens have been known as Americans since then. There is no
confusion on this side of the water about that. Canadian and Mexican
people while sharing the North American continent with us do not
describe themselves as American, rather as Canadian and Mexican.
And you know that perfectly well. You lost the battle at Yorktown. Get
over it.
Some of us (Americans) are proud of our heritage. This year marks the
400th anniversary of the founding of Jamestown, the first permanent
English settlement in the New World.
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
CBFalconer wrote:
Malcolm McLean wrote:
... snip ...
>Unfortunately "Yank" is derogatory. "Usanian" is not a pronounceable word. "Republicans" would be accurate but has been taken by a political party. There just isn't a good word for our friends from over the pond.
On the contrary, around here designating somewon as a Yankee is a
compliment. The point is that it is regional. Something like
calling all UKanians "Cockneys".
I'm told, in Mexico, yanqui is anyone north of the Rio Grande. In Texas
a yankee is anyone north of the Mason-Dixon line. In New York a yankee
is anyone from New England. In New England a yankee is from Maine and
eats Blueberry pie for breakfast. :-)
--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Keith Thompson wrote:
"Default User" <de***********@yahoo.comwrites:
Many Americans consider it HIGHLY insulting to use such neologisms
in place of the proper name.
Speaking as an American, it doesn't bother me at all.
Sure, and that's great. I've just grown tired of it.
This is entirely off-topic, and it's vanishingly unlikely that
anything is going to be resolved here. I suggest that both sides of
this debate quietly declare victory and move on.
As I said, I'm coming out and declaring, "I am an American". If people
use what I consider to be insulting terms for me and my countrymen on
this group, they're going to have to deal a fight over each time.
Whether they care or not is up to them.
Brian
Joe Wright said:
Richard Heathfield wrote:
<snip>
>If anything is insulting to Americans, it is the suggestion that the majority of them don't count as American, simply because they are not from the United States.
I think not.
That is your privilege, but I still disagree with you.
<snip>
You lost the battle at Yorktown.
No, I didn't. I wasn't even present. In fact, I wasn't even born.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
Default User said:
<snip>
As I said, I'm coming out and declaring, "I am an American".
As far as I can tell, nobody has suggested otherwise.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk
email: rjh at the above domain, - www.
"Default User" <de***********@yahoo.comwrites:
Keith Thompson wrote:
>"Default User" <de***********@yahoo.comwrites:
Many Americans consider it HIGHLY insulting to use such neologisms
in place of the proper name.
Speaking as an American, it doesn't bother me at all.
Sure, and that's great. I've just grown tired of it.
>This is entirely off-topic, and it's vanishingly unlikely that anything is going to be resolved here. I suggest that both sides of this debate quietly declare victory and move on.
As I said, I'm coming out and declaring, "I am an American". If people
use what I consider to be insulting terms for me and my countrymen on
this group, they're going to have to deal a fight over each time.
Whether they care or not is up to them.
I just don't understand why you find "USAnian" to be insulting.
Silly, sure, but the country of which we're both proud to be citizens
is called, among other things, the "USA". (It's also referred to as
the US, The States, and a number of other things.)
Nobody objects to your calling yourself an American. I just think
you're seeing an insult where none was intended or can be reasonably
inferred. The term was used in passing in a discussion of the ANSI
and ISO C standard(s); seizing on it and starting an utterly off-topic
debate is less than constructive. (And I'm not helping by
participating in it.)
--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
On Mar 10, 7:55 am, Zhou Yan <zhouyan1...@gmail.comwrote:
CBFalconer <cbfalco...@yahoo.comwrites:
Zhou wrote:
the code above is not valid for ANSI C but valid for C99, and gcc
think it is OK.
C99 is ANSI C. You mean not valid for C90.
ANSI C is referred to C89.
By you, perhaps, but wrongly.
In 1989 ANSI published the first C standard.
In 1990 ISO adopt this C89 as ISO 9899:1990, so called C90
And in 1990 ANSI adopted ISO C90 as the replacement ANSI C Standard.
In 1999 ISO published the ISO 9899:1999, so called C99
And in 1999 ANSI adopted ISO C99 as the replacement ANSI C Standard.
ANSI only published C89 and C99 is ISO C.
No, ANSI has Standardized and published all the C Standards.
When reffered to ANSI C we always refer to C89 or equivalent, C90.
Strictly, "ANSI C" now means C99. Colloquially it means any of the
ANSI C Standards from C89 to C99.
For instance, in GCC, -ansi is the same as -std=c89 option.
For historical reasons, dating from when C89 was the ANSI C Standard.
On Mar 11, 9:01 pm, Yevgen Muntyan <muntyan.removet...@tamu.edu>
wrote:
Did you ask these people if they are Americans and if they find it
insulting when someone calls them Americans?
Anyway, I am not an American nor a Great-Britaininan, so I guess I
miss very important details about this argument.
Does it bother Kazakhs, Latvians, Uzbeks, Chechens, etc.
to be called Russian?
Old Wolf wrote:
On Mar 11, 9:01 pm, Yevgen Muntyan <muntyan.removet...@tamu.edu>
wrote:
>Did you ask these people if they are Americans and if they find it insulting when someone calls them Americans?
Anyway, I am not an American nor a Great-Britaininan, so I guess I miss very important details about this argument.
Does it bother Kazakhs, Latvians, Uzbeks, Chechens, etc.
to be called Russian?
<OT>
Are they Russians? Even better, is there a continent named Rusia?
Better yet, do the North Russia and South Russia exist? People
from Canada are Canadians, people from the United States of
America are Americans, people from Brasil are Brasilians (there
was a relatively funny joke about Bush and brazillion :-) ).
Everyone in my country (Romania) was referring to people from the
US as Americans and everybody else did until recently. Although
they are the only Americans. Brazilians are South Americans,
Canadians are North Americans. United States of America does not
make any reference to North and South. I am not an American and
have not much of an interest in this discussion but America is
usually associated with the US not the land mass of the
"Americas". Can someone enlighten me who invented USAnians and
when because almost every time I heard USAnians as opposed to
Americans it was done in a derogatory fashion. Still baffled by
the fact that you don't yet hear "death to USAnians!".
</OT>
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Keith Thompson wrote:
"Default User" <de***********@yahoo.comwrites:
Keith Thompson wrote:
"Default User" <de***********@yahoo.comwrites:
Many Americans consider it HIGHLY insulting to use such
neologisms in place of the proper name.
>
Speaking as an American, it doesn't bother me at all.
Sure, and that's great. I've just grown tired of it.
This is entirely off-topic, and it's vanishingly unlikely that
anything is going to be resolved here. I suggest that both sides
of >this debate quietly declare victory and move on.
As I said, I'm coming out and declaring, "I am an American". If
people use what I consider to be insulting terms for me and my
countrymen on this group, they're going to have to deal a fight
over each time.
Whether they care or not is up to them.
I just don't understand why you find "USAnian" to be insulting.
Silly, sure, but the country of which we're both proud to be citizens
is called, among other things, the "USA". (It's also referred to as
the US, The States, and a number of other things.)
It's because of the attitude, expressed here, "you've stolen the name
American and kept other legitmate users from it, so you get it."
It's a load of crap. These guys aren't bleeding for the people in Peru
or Canada that are deprived of being called "American". They want to
stick it to us. I'm tired of it.
If they just so PC that they can't bear to use the term in its
traditional and most widespread fashion, then perhaps they'd be better
off rewording the sentences to avoid either term.
Brian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Salisha Khan |
last post by:
I have an instance method that takes an ansi string.
Dim foo As Object
foo(String a)
The problem is Strings in VB .NET are unicode while in order for the method
to work it must accept an...
|
by: Jack |
last post by:
Hi I am just trying to get a feel for what oracle SQL syntax there is
that would not be covered at all in anyway from a functionality
perspective in the standard ANSI SQL..
Any input is...
|
by: ColdCanuck |
last post by:
Help!
I'm trying to understand the new ANSI join syntax (after many years of
coding using the old style). I am now working with an application that only
understands ANSI syntax so I am...
|
by: celsius |
last post by:
Hi all,
please forgive me if this already posted many times.
i was reading peter van der linden's book expert C programming.
on page number 188,he is discussing about implementing finite state...
|
by: ehchn1 |
last post by:
Hi,
Just curious. Would you use ANSI style table joining or the 'old
fashion' table joining; especially if performance is the main concern?
What I meant is illustrated below:
ANSI Style...
|
by: sunny |
last post by:
Hi All
What is C99 Standard is all about. is it portable, i mean i saw
-std=C99 option in GCC
but there is no such thing in VC++.?
which one is better ANSI C / C99?
can i know the major...
|
by: dunleav1 |
last post by:
I have an application that uses the old join syntax instead of the
SQL92 standards join syntax.
I need to justify changing the code to the new standard.
Is there any performance issue related to...
|
by: Gary |
last post by:
Is the above available?
I've been looking at ISO/IEC 9075-2:2003 and the dynamic SQL syntax
contained there works fine on Oracle when embedded in a COBOL
application but I get errors such as:
...
|
by: unauthorized |
last post by:
Hi guys. I've been trying to compile the pcre library for use with the MSVC compiler, but the code wouldn't compile because it needed the func strtoq which isn't part of my C(++) library.
Anyway, I...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
| |