tests: cal/bigyear only works on 64bit (sizeof(long) == 8) systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux