rchampe@hubcap.UUCP (11/26/87)
I'm having trouble reading shorts using scanf when I compile using the
+l option. Here's a test program I tried.
short i;
main()
{
printf("==> ");
scanf("%hd",&i);
printf("i: %d\n",i);
}
First I compiled this using:
cc test.c
ln test.o -lc
and at the prompt, entered 5, it printed:
i: 5
However, when I compiled the program using:
cc test.c +l
ln test.o -lc32
and at the prompt, entered 5, it printed:
i: 0
Most of the time when I try to read shorts, I get large negative numbers.
Am I doing something wrong, or is there a bug in 3.4a? If it's a bug,
is it going to be fixed in 3.6?
Rich Champeaux
Clemson University