Compiling GCC With a C++ Compiler (g++)

Andreas Schwab schwab@suse.de
Thu Oct 14 18:40:00 GMT 2004


Gabriel Dos Reis <gdr@cs.tamu.edu> writes:

> | What about this function: is it valid, conformant C?
> | 
> | void fubar (const char *x)
> | {
> |     *(char *)x = '?';
> | }
>
> It is valid C and C++, if only if the object pointed to by x is const.

No, it isn't.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc mailing list