delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/08/12/14:23:35

From: Kbwms AT aol DOT com
Message-ID: <193.1e4fa777.2c6a8a99@aol.com>
Date: Tue, 12 Aug 2003 14:23:21 EDT
Subject: Re: djgpp/tests/cygnus/sprint_ivec.c broken?
To: djgpp-workers AT delorie DOT com
MIME-Version: 1.0
X-Mailer: 8.0 for Windows sub 6011
Reply-To: djgpp-workers AT delorie DOT com

--part1_193.1e4fa777.2c6a8a99_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

In a message dated 8/12/2003 1:49:57 PM Eastern Standard Time, 
ams AT ludd DOT luth DOT se writes:

> I've noticed that there are a lot of sprintf specifications that has
> the "#" flag for the "d" conversion in
> djgpp/tests/cygnus/sprint_ivec.c.
> 
> E. g. lines 125 and 126:
> __LINE__, 0x001dc6bb,   "1951419", "%#4ld",
> __LINE__, 0x00000868,   "  2152", "%#6d",
> 
> This is weird and IMO broken, because the standard says that the "#"
> flag is only valid for the o, x, X, a, A, e, E, f, F, g and G
> conversions and undefined behaviour for the other conversions.
> 
> It's broken because having tests that relies on undefined behaviour
> doesn't make sense.
> 
> Comments?
> 

As I recall, the # flag is ignored with c, d, i, u, or s conversions.  
Problem?

--part1_193.1e4fa777.2c6a8a99_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><FONT FACE=3Darial,helvetica><FONT  SIZE=3D3 FAMILY=3D"SERIF" FACE=3D"=
Georgia" LANG=3D"0">In a message dated 8/12/2003 1:49:57 PM Eastern Standard=
 Time, ams AT ludd DOT luth DOT se writes:<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"></FONT><FONT  COLOR=3D"#000000"=
 style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=3D"A=
rial" LANG=3D"0">I've noticed that there are a lot of sprintf specifications=
 that has<BR>
the "#" flag for the "d" conversion in<BR>
djgpp/tests/cygnus/sprint_ivec.c.<BR>
<BR>
E. g. lines 125 and 126:<BR>
__LINE__, 0x001dc6bb,&nbsp;&nbsp; "1951419", "%#4ld",<BR>
__LINE__, 0x00000868,&nbsp;&nbsp; "&nbsp; 2152", "%#6d",<BR>
<BR>
This is weird and IMO broken, because the standard says that the "#"<BR>
flag is only valid for the o, x, X, a, A, e, E, f, F, g and G<BR>
conversions and undefined behaviour for the other conversions.<BR>
<BR>
It's broken because having tests that relies on undefined behaviour<BR>
doesn't make sense.<BR>
<BR>
Comments?<BR>
</BLOCKQUOTE><BR>
</FONT><FONT  COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3=
 FAMILY=3D"SERIF" FACE=3D"Georgia" LANG=3D"0"><BR>
As I recall, the # flag is ignored with c, d, i, u, or s conversions.&nbsp;=20=
Problem?</FONT></HTML>

--part1_193.1e4fa777.2c6a8a99_boundary--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019