From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,fdc1a44e88d600ef,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-02-08 11:59:43 PST Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!spool.mu.edu!hri.com!noc.near.net!viewlog.viewlogic.com!greg From: greg@mobius.viewlogic.com (Gregory Larkin) Newsgroups: comp.sys.dec Subject: Problem with strtol() on ULTRIX 4.2 Message-ID: <1993Feb8.195943.23775@viewlogic.com> Date: 8 Feb 93 19:59:43 GMT Sender: greg@mobius (Gregory Larkin) Organization: Viewlogic Systems, Inc. Originator: greg@mobius Nntp-Posting-Host: mobius Hi there, I am having a problem with the way that strtol() works on a Decstation 5000 running Ultrix 4.2. On the Sparcstation, strtol() yields these results: strtol("7fffffff", (char **)NULL, 16) = 2147483647 strtol("80000000", (char **)NULL, 16) = -2147483648 strtol("ffffffff", (char **)NULL, 16) = -1 However, on the Decstation, strtol() cannot yield negative numbers. On the Dec: strtol("7fffffff", (char **)NULL, 16) = 2147483647 strtol("80000000", (char **)NULL, 16) = 2147483647 strtol("ffffffff", (char **)NULL, 16) = 2147483647 Should I be using something other than strtol() on the Dec to get it to behave like the Sun does? Is this a C library bug on Ultrix? Thanks for any help! -- Greg Larkin, Software Engineer, Waveform Analysis Viewlogic Systems, Inc. Marlboro, MA 01752 greg@Viewlogic.COM