From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aa7b0448abeecbba X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: How to print Task_ID type? (GNAT SunOS) Date: 1996/04/06 Message-ID: <4k50tc$7ge@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 146058733 references: <4xu3yzpoi7.fsf@leibniz.enst-bretagne.fr> <4k1ma9$brt@michp1.redstone.army.mil> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.ada Date: 1996-04-06T00:00:00+00:00 List-Id: joel@redstone.army.mil (Joel Sherrill) writes: > I am not sure what the origin of the "%p" printf specifier is but it is > present for all the C libraries I use. With it, you can: > > printf( "The address of X is %p\n", &X ); Incidentally, that code fragment has undefined behaviour. You need to write printf( "The address of X is %p\n", (void *) &X ); This is because the C standard allows implementations to represent different pointer types differently. (What relevance does this have to comp.lang.ada? Just another example of how easy it is to shoot yourself in the foot in languages with less compile-time and run-time checking.) -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.