This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: incorrect static char * assumption(?)
- To: blackw at sfu dot ca
- Subject: Re: incorrect static char * assumption(?)
- From: Horst von Brand <vonbrand at pincoya dot inf dot utfsm dot cl>
- Date: Tue, 07 Mar 2000 18:09:13 -0300
- cc: gcc-bugs at gcc dot gnu dot org
Richard <blackw@sfu.ca> said:
> egcs-2.91.66 appears to be making an erroneous assumption about the
> contents of a static char * within a single printf() call.
You are calling a function that modifies a global variable (side effect)
twice in ths argument list of a function. Noone guarantees in which order
the arguments of a function call are evaluated, so you are invoking
undefined behaviuor: Anything can happen.
--
Dr. Horst H. von Brand mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513