This is the mail archive of the gcc@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]
Other format: [Raw text]

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



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



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