🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Stefan Ullrich Mon, 23 Nov 1992 19:05
potential gcc-error
#1476
Author: Stefan Ullrich
Date: Mon, 23 Nov 1992 19:05
51 lines
1826 bytes
Dear Sirs,

this a bug report to gcc-2.3.1.

It is a little bug we found in the gcc-2.3.1. It causes no errors
during programm execution but is a little bit confusing since you get a
warning from the compiler.

The problem is that gcc-2.3.1 doesnot accept without warning the
smallest possible integer for a signed long int if it is written in
decimal (-2147483648).  It accepts the same value as hex number
(0x80000000). It also accepts the int number (-2147483647) without
warning. We havenot found any problems during execution.

We wrote a little programm to demonstrate the behaviour of gcc-2.3.1.
This is the little programm called `example.c':

> #include <stdio.h>
>
>
> int main(void){
>
>   long int i,j;
>
>   i = -2147483648;
>   j = 0x80000000;
>   printf("\nmax_neg_dez : %d", i);
>   printf("\nmax_neg_hex : %d\n\n", j);
>   return;
> }

This the compiler call:

> gcc -o example example.c

This is the error message that was produced by gcc:

> example.c: In function `main':
> example.c:8: warning: integer constant is so large that it is unsigned

This is the ouput produced by `example':

>
> max_neg_dez : -2147483648
> max_neg_hex : -2147483648
>

We hope that this bug report will help to improve the new release of gcc.

Many thanks to all who worked on this compiler. It is a great advance
for our work.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads