public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Request for help
@ 2004-01-07  4:06 Srinivas Vangara (svangara)
  2004-01-07  4:44 ` Andrew Bevitt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Srinivas Vangara (svangara) @ 2004-01-07  4:06 UTC (permalink / raw)
  To: gcc-help; +Cc: svangara

Hi 

Is the statement:

a[i]=a[i++]; a valid statement as per ANSI C standards or the behaviour
is undefined and the implementation is compiler dependent?

Looks like gcc is treating this as a[i]=a[i];i++; Where as the
programmers intention could be a[i+1]=a[i];i++;

Does the C language ANSI standard enforce any evaluation order or the
implementation is left to the compiler?

Thanks & Regards,
Srinivas.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
  2004-01-07  4:06 Request for help Srinivas Vangara (svangara)
@ 2004-01-07  4:44 ` Andrew Bevitt
  2004-01-07  7:49 ` Falk Hueffner
  2004-01-08 13:19 ` Andrea 'Fyre Wyzard' Bocci
  2 siblings, 0 replies; 11+ messages in thread
From: Andrew Bevitt @ 2004-01-07  4:44 UTC (permalink / raw)
  To: gcc-help

> a[i]=a[i++]; 

I read this as saying assign to the array a's position i, the value stored
in array a's position i, and then increment i. In code this would be 

a[i] = a[i]; i++; 

> Looks like gcc is treating this as a[i]=a[i];i++; Where as the
> programmers intention could be a[i+1]=a[i];i++;

The programmers intention could never be that unless they really 
are not sure about prefix / postfix notation and the usage of arrays.

There are subtle differences: A) Assign to array a's position i, the
value stored in array a at position i, then increment i. B) Assign to
array a's position i+1 the value of array a at position i, then inc i.

> Does the C language ANSI standard enforce any evaluation order or the
> implementation is left to the compiler?

i++ will increase i after any other operation on the line is complete
++i will increase i and then perform the other operations.

Note you cannot just issue : a[i] = a[++i]; either though, as the new position
i (ie i+1) will be used for both the assigned value position and the read.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
  2004-01-07  4:06 Request for help Srinivas Vangara (svangara)
  2004-01-07  4:44 ` Andrew Bevitt
@ 2004-01-07  7:49 ` Falk Hueffner
  2004-01-08 13:19 ` Andrea 'Fyre Wyzard' Bocci
  2 siblings, 0 replies; 11+ messages in thread
From: Falk Hueffner @ 2004-01-07  7:49 UTC (permalink / raw)
  To: svangara; +Cc: gcc-help

"Srinivas Vangara \(svangara\)" <svangara@cisco.com> writes:

> Is the statement:
> 
> a[i]=a[i++]; a valid statement as per ANSI C standards or the behaviour
> is undefined and the implementation is compiler dependent?

It's undefined. See the documentation on -Wsequence-point.

-- 
	Falk

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
  2004-01-07  4:06 Request for help Srinivas Vangara (svangara)
  2004-01-07  4:44 ` Andrew Bevitt
  2004-01-07  7:49 ` Falk Hueffner
@ 2004-01-08 13:19 ` Andrea 'Fyre Wyzard' Bocci
  2 siblings, 0 replies; 11+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2004-01-08 13:19 UTC (permalink / raw)
  To: svangara, gcc-help; +Cc: svangara


>a[i]=a[i++];

IIRC it's undefined, as the standard doesn't say in which order the left 
nad right side of '=' have to be avaluated.

.fw.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: request for help
  2004-03-30  0:26 request " Siddhartha S
@ 2004-03-30  7:25 ` llewelly
  0 siblings, 0 replies; 11+ messages in thread
From: llewelly @ 2004-03-30  7:25 UTC (permalink / raw)
  To: Siddhartha S; +Cc: gcc-help

Siddhartha S <sidharta@yahoo-inc.com> writes:

> Hi,
> 	Could you please point me to an authoritative document with changes in gcc3.0 
> with respect to gcc 2.95.*  especially with respect to c++ both in terms of 
> compatibility/performance?

First note that gcc 3.0 is quite old, and somewhat problematical
    compared to earlier and later releases of gcc. I strongly suggest
    you upgrade to gcc 3.3.3 instead. 

The new features for 3.0 are here:
    http://gcc.gnu.org/gcc-3.0/features.html
See also the caveats page:
    http://gcc.gnu.org/gcc-3.0/caveats.html

The new features for 3.3.3 are here:
    http://gcc.gnu.org/gcc-3.3/changes.html

Amoung other things, please note gcc 3+ requires proper using
    directives, using declarations, and/or std:: qualifications for
    standard C++ library components, as required by the 1998
    standard. 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* request for help
@ 2004-03-30  0:26 Siddhartha S
  2004-03-30  7:25 ` llewelly
  0 siblings, 1 reply; 11+ messages in thread
From: Siddhartha S @ 2004-03-30  0:26 UTC (permalink / raw)
  To: gcc-help; +Cc: sidharta

Hi,
	Could you please point me to an authoritative document with changes in gcc3.0 
with respect to gcc 2.95.*  especially with respect to c++ both in terms of 
compatibility/performance? 
Thanks
Siddhartha S

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
@ 2003-07-07 11:33 Wayne
  0 siblings, 0 replies; 11+ messages in thread
From: Wayne @ 2003-07-07 11:33 UTC (permalink / raw)
  To: gcc-help

Note also that version 3.04 is several releases old.  
Dev-C++ for example uses version 3.2...

Wayne Keen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
  2003-07-07  6:06 kiran kumar
@ 2003-07-07  9:23 ` Andrea 'fwyzard' Bocci
  0 siblings, 0 replies; 11+ messages in thread
From: Andrea 'fwyzard' Bocci @ 2003-07-07  9:23 UTC (permalink / raw)
  To: kiran kumar; +Cc: gcc-help

You might prefere to download a precompiled (binary) version of GCC, 
instead of a source distribution.
See <http://www.mingw.org> for a Windows version.
You might also have a look at <http://www.bloodshed.net/devcpp.html> for an 
IDE wich support GCC.

.fw.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Request for help
@ 2003-07-07  6:06 kiran kumar
  2003-07-07  9:23 ` Andrea 'fwyzard' Bocci
  0 siblings, 1 reply; 11+ messages in thread
From: kiran kumar @ 2003-07-07  6:06 UTC (permalink / raw)
  To: gcc-help

Respected Sir/Madam,
                   I am developing mobile games using
C,C++ and BREW. For Emulator I am generating Win32
dll. For target device I need ".mod" file which will
be in binary format. I downloaded the
"gcc-g++-3.0.4.tar.gz". But i am not able to get it
installed and use it for generating ".mod" file. Any
other files i have to download? How to install? how to
compile the code using GCC? please help me to get out
of this problem.


Thanks & Regards,
Kiran Kumar . T


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Request for help
  2002-02-04 23:14 suraj bhatt
@ 2002-02-06 15:27 ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 0 replies; 11+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2002-02-06 15:27 UTC (permalink / raw)
  To: suraj bhatt; +Cc: gcc-help

At 23.14 04/02/2002 (GMT -0800), you wrote:
>Hi,
>   I'm Suraj Bhatt currently studying in degree course
>(computer engg.) & visitors of your site.
>   I'm currently working on 'SS7 over IP' project.For
>the development of this project i want compiler.
>
>   * Since for that project, Can GCC compiler use to
>develop ?

I think you can use GCC to COMPILE anything you want.

>   * If so, how can i get that compiler ?

See the GCC web pages, <http://gcc.gnu.org>.
There you'll find instructions on how to download, configure and install 
GCC from sources. To be able to do this, you will need a working C compiler.
If you don't already have one, or if you prefere not to do that, you can 
obtain precompiled versions of GCC for many architectures.
You won't find them on the GCC web site. Instead, try asking the provider 
of your OS.

>   * i came to know that GNU software will be used for
>development of SS7 project.So, please inform me by
>mail.
>   * Is this project available in India so, give name
>of supplier.
>
>Waiting for reply...
>Regards
>Suraj.

I hope this will help you. If you have problems regarding the installation 
of GCC, and you can't solve them after reading the web pages, feel free to 
ask help on this mailing list.

fwyzard

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Request for help
@ 2002-02-04 23:14 suraj bhatt
  2002-02-06 15:27 ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 1 reply; 11+ messages in thread
From: suraj bhatt @ 2002-02-04 23:14 UTC (permalink / raw)
  To: gcc-help

Hi,
  I'm Suraj Bhatt currently studying in degree course
(computer engg.) & visitors of your site.
  I'm currently working on 'SS7 over IP' project.For
the development of this project i want compiler. 
  
  * Since for that project, Can GCC compiler use to
develop ?
  * If so, how can i get that compiler ?
  * i came to know that GNU software will be used for
development of SS7 project.So, please inform me by
mail.
  * Is this project available in India so, give name
of supplier.

Waiting for reply...
Regards
Suraj.

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-03-30  0:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07  4:06 Request for help Srinivas Vangara (svangara)
2004-01-07  4:44 ` Andrew Bevitt
2004-01-07  7:49 ` Falk Hueffner
2004-01-08 13:19 ` Andrea 'Fyre Wyzard' Bocci
  -- strict thread matches above, loose matches on Subject: below --
2004-03-30  0:26 request " Siddhartha S
2004-03-30  7:25 ` llewelly
2003-07-07 11:33 Request " Wayne
2003-07-07  6:06 kiran kumar
2003-07-07  9:23 ` Andrea 'fwyzard' Bocci
2002-02-04 23:14 suraj bhatt
2002-02-06 15:27 ` Andrea 'Fyre Wyzard' Bocci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).