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

Jan-Benedict Glaw jbglaw@lug-owl.de
Fri Dec 12 13:07:00 GMT 2003


On Thu, 2003-12-11 09:01:51 -0800, Geoff Keating <geoffk@geoffk.org>
wrote in message <jmllpjxp8g.fsf@desire.geoffk.org>:
> Segher Boessenkool <segher@kernel.crashing.org> writes:

> > 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'.

Um, I think:
	- You may include <stdio.h> as long as your new printf() has
	  compatible arguments. It's a Bad Thing, though, because
	  declaration in <stdio.h> doesn't really belong to your new
	  function.
	- You may also have your own function non-static. Then, it
	  depends on link-order which function (yours or libc's) is
	  used. Of course, that's horrible, too:)

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20031212/18c22336/attachment.sig>


More information about the Gcc mailing list