public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* tests: cal/bigyear only works on 64bit (sizeof(long) == 8) systems
@ 2013-12-23  2:42 Mike Frysinger
  2014-01-06 12:30 ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2013-12-23  2:42 UTC (permalink / raw)
  To: util-linux

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

the cal bigyear test uses a year of 1234567890123456789, but the parsing logic 
reads it in like so:
	year = strtol_or_err(*argv++, _("illegal year value"));

that's a signed long type, so on 32bit systems, you get:
          cal: Year 1234567890123456789       ...cal: illegal year value: 
'1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
cal: illegal year value: '1234567890123456789': Numerical result out of range
 FAILED (cal/bigyear)

should the test detect the sizeof(long) and then calculate a number that is 
smaller than that ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-13 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23  2:42 tests: cal/bigyear only works on 64bit (sizeof(long) == 8) systems Mike Frysinger
2014-01-06 12:30 ` Karel Zak
2014-01-06 12:55   ` Sami Kerola
2014-01-06 13:08     ` Karel Zak
2014-01-06 23:21       ` Sami Kerola
2014-01-13 12:02         ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox