🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1168

2.2.2 constant expression range checking

#1168
From: Kenneth Herron
Date: Wed, 07 Oct 1992 16:16
41 lines
2157 bytes
Our gcc has had several of Paul Eggert's patches applied, and I think
one of them is at fault here, so if they're not to be considered 
official then take this with a grain of salt.

This file, compiled with "gcc -c testit.c":
----------------
/* #include <sys/types.h> */
#ifndef u_char
#define u_char  unsigned char
#endif

static u_char badmap[] = {
	'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
};
static char goodmap[] = {
	'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
};
----------------
produces:
----------------
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
gcc-test.c:8: warning: constant expression out of range for unsigned type
----------------
Uncommenting the #include line and commenting out the #define makes
no difference.

gcc -v returns:

Reading specs from /xbin/gnu/lib/gcc-lib/symmetry-dynix/2.2.2/specs
gcc version 2.2.2
-- 
Kenneth Herron                                   kherron@ms.uky.edu
University of Kentucky                              +1 606 257 2975
Department of Mathematics      I just thought of a neat disproof of
     Fermat's last theorem, but .signatures can only be four lines.
Technical Details
Message-ID: <9210071616.aa22653@s.s.ms.uky.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ms.UKy.EDU!kherron

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!ms.UKy.EDU!kherron
From: kherron@ms.UKy.EDU (Kenneth Herron)
Subject: 2.2.2 constant expression range checking
Message-ID: <9210071616.aa22653@s.s.ms.uky.edu>
Sender: gnulists@ai.mit.edu
Organization: University Of Kentucky, Dept. of Math Sciences
Distribution: gnu
Date: Wed, 7 Oct 1992 16:16:02 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 42