From: Message-Id: <200308171042.h7HAgJ1H019444@speedy.ludd.luth.se> Subject: Re: djgpp/tests/cygnus/sprint_ivec.c broken? In-Reply-To: <193.1e4fa777.2c6a8a99@aol.com> "from Kbwms@aol.com at Aug 12, 2003 02:23:21 pm" To: djgpp-workers AT delorie DOT com Date: Sun, 17 Aug 2003 12:42:19 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL78 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-MailScanner: Found to be clean Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk According to Kbwms AT aol DOT com: > 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. ... > > 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. ... > As I recall, the # flag is ignored with c, d, i, u, or s conversions. > Problem? Yes. What must we do if one of those fail? Nothing, because we're allowed to do anything. (We may be interested in correcting it anyway to be (un)kind to coders that relies on undefined behaviour.) However the illegal tests are sprinkled all over the test array. I would have put them separate from the valid tests with a comment /* These are test of certain extensions of sprintf, which may or may not work as expected. */. Right, MartinS