Xref: utzoo comp.std.c:2566 comp.lang.c:26684 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think!mintaka!ogicse!intelhf!dios!clubmed.hf.intel.com!martin From: martin@clubmed.hf.intel.com.ogi.edu Newsgroups: comp.std.c,comp.lang.c Subject: ANSI scanf dropping sign bit? Keywords: ANSI Message-ID: <491@dios.hf.intel.com> Date: 7 Mar 90 16:02:12 GMT Sender: martin@dios.hf.intel.com Reply-To: martin@clubmed.hf.intel.com (Martin Wilde) Organization: OMSO Software Engineering - Intel Corp. - Hillsboro Or. Lines: 34 Why does the following program when linked to an ANSI standard library produce the following: input: 90000000 output: 10000000 input: 80000000 output: 00000000 #include int main() { unsigned int input; scanf("%x", &input); printf("%x\n", input); } It appears that sign bit is being dropped. I have run this program on Sys V.3.2 and it retains the sign bit, but this is not ANSI compliant. Any hints... thanks _/_ | ______ __. __ / o ____ | textronix!reed!intelhf!clubmed!martin / / / <_(_/|_/ (_<__<_/ / < | | martin@clubmed.hf.intel.com |