🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #1865

Re: Coding Standards are ignorant

#1865
From: Michael I. Bushnell, p/BSG
Date: Mon, 18 Mar 1996 15:59
30 lines
1614 bytes
In article <4ifq40$i87@sundog.tiac.net> stanr@tiac.net (Stan Ryckman) writes:

   (Added comp.std.c; those folks may skip to my question at the end)

   In article <MIB.96Mar16174948@gnu.ai.mit.edu>,
   Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> wrote:

   [snip]

   [re Posix.2]
   >You can't use printf to print any manifest integer type of unknown
   >size, except for size_t.  (And that one only because ANSI went and
   >added a special format code for size_t.)

   Can't you safely do this with casting to the (possibly unsigned) long
   type?  e.g.,
	   pid_t whatever;
	   ...
	   printf( "%lu\n", (unsigned long) whatever);
   A pain, but hardly a "can't".

You are not guaranteed that long is the widest integral type.  

   Oh, and what's that special ANSI format code for size_t?  I can't find
   it in 4.9.6.1; was it added after printing or am I just blind?

I was wrong; there is not such ANSI format code.  The one I was
thinking of is a GNU extension.

Michael
Technical Details
Message-ID: <MIB.96Mar18105957@gnu.ai.mit.edu>
Path: arc1-ca.pugleaf.net!life.ai.mit.edu!mib
References: <4gum82$14v4@info4.rus.uni-stuttgart.de> <MIB.96Mar15170902@gnu.ai.mit.edu> <wyraut5fqq.fsf@dns.bluesky.net> <MIB.96Mar16174948@gnu.ai.mit.edu> <4ifq40$i87@sundog.tiac.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!life.ai.mit.edu!mib
From: mib@gnu.ai.mit.edu (Michael I. Bushnell, p/BSG)
Newsgroups: gnu.misc.discuss,comp.std.c
Subject: Re: Coding Standards are ignorant
Date: 18 Mar 1996 15:59:57 GMT
Organization: Free Software Foundation, Cambridge, MA
Message-ID: <MIB.96Mar18105957@gnu.ai.mit.edu>
References: <4gum82$14v4@info4.rus.uni-stuttgart.de>
 <MIB.96Mar15170902@gnu.ai.mit.edu> <wyraut5fqq.fsf@dns.bluesky.net>
 <MIB.96Mar16174948@gnu.ai.mit.edu> <4ifq40$i87@sundog.tiac.net>
NNTP-Posting-Host: duality.ai.mit.edu
In-reply-to: stanr@tiac.net's message of 17 Mar 1996 01:32:48 GMT