This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: incorrect static char * assumption(?)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]