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

ANSI C syntax ?

P: n/a
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

Mar 10 '07 #1
Share this Question
Share on Google+
127 Replies


P: n/a
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.

Mar 10 '07 #2

P: n/a
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.
Mar 10 '07 #3

P: n/a
SRR
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?

Mar 10 '07 #4

P: n/a
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.

Mar 10 '07 #5

P: n/a
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 ] )
Mar 10 '07 #6

P: n/a
SRR
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 -

Mar 10 '07 #7

P: n/a
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.

Mar 10 '07 #8

P: n/a
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

Mar 10 '07 #9

P: n/a
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...
Mar 10 '07 #10

P: n/a

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?

Mar 10 '07 #11

P: n/a
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.
Mar 10 '07 #12

P: n/a
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 :-)

Mar 10 '07 #13

P: n/a
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>

Mar 10 '07 #14

P: n/a
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.
Mar 10 '07 #15

P: n/a
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.
Mar 10 '07 #16

P: n/a

Thank you for everyone.
I understood that it was GCC expansion.

tsuyoshi

Mar 10 '07 #17

P: n/a
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
Mar 10 '07 #18

P: n/a
"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
Mar 10 '07 #19

P: n/a
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

Mar 10 '07 #20

P: n/a
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.
Mar 10 '07 #21

P: n/a
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
Mar 11 '07 #22

P: n/a
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

Mar 11 '07 #23

P: n/a
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

Mar 11 '07 #24

P: n/a
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"
Mar 11 '07 #25

P: n/a
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
Mar 11 '07 #26

P: n/a
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
Mar 11 '07 #27

P: n/a
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
Mar 11 '07 #28

P: n/a
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.
Mar 11 '07 #29

P: n/a
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.
Mar 11 '07 #30

P: n/a
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.
Mar 11 '07 #31

P: n/a
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
Mar 11 '07 #32

P: n/a
"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"
Mar 11 '07 #33

P: n/a
"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

Mar 11 '07 #34

P: n/a
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

Mar 11 '07 #35

P: n/a
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.
Mar 11 '07 #36

P: n/a
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

Mar 11 '07 #37

P: n/a
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

Mar 11 '07 #38

P: n/a
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

Mar 11 '07 #39

P: n/a
"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"
Mar 11 '07 #40

P: n/a
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 ---
Mar 11 '07 #41

P: n/a
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 ---
Mar 11 '07 #42

P: n/a
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
Mar 11 '07 #43

P: n/a
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.
Mar 11 '07 #44

P: n/a
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.
Mar 11 '07 #45

P: n/a
"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"
Mar 11 '07 #46

P: n/a
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.

Mar 11 '07 #47

P: n/a
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?

Mar 11 '07 #48

P: n/a
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...)
Mar 11 '07 #49

P: n/a
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

Mar 11 '07 #50

127 Replies

This discussion thread is closed

Replies have been disabled for this discussion.