(printf) ("hello world\n");

Segher Boessenkool segher@kernel.crashing.org
Thu Dec 11 17:39:00 GMT 2003


>>>> It is reserved only in translation units that have stdio.h 
>>>> #include'd.
>>>
>>> It is reserved (in a hosted environment) as an identifier with 
>>> external
>>> linkage regardless of what headers are included (7.1.3#1).
>>
>> That does not prevent you from declaring and defining your own
>> printf() function (with a different prototype) though; it only 
>> requires
>> that you make that function have external linkage.
>
> You mean 'internal linkage'.  You can define your own function named
> printf only if you (a) do not include stdio.h and (b) declare it
> 'static'.

That makes more sense, yes.  I think I misinterpreted what "reserved as
an identifier with external linkage" means.  Whoops.


Segher



More information about the Gcc mailing list