🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2153

gcc 1.32 give potentially spurious warning?

#2153
From: "Douglas C. Schmidt"
Date: Sun, 15 Jan 1989 00:39
49 lines
1847 bytes
Bug Report for GCC:
-------------------
Problem : In the short program below, gcc 1.32 complains about requesting
          an address for register int array ``foo'' when the *(x) notation 
          is used, but not when the equivalent x[] notation is used.
          Sun CC doesn't complain in either case. 

1.) Version : gcc 1.32
-----------

2.) Input Program :
-----------------

main ( ) {
   register int foo[10];

   *(foo + 2) = 10; /* a warning is given here, but why? */
   foo[2]     = 10; /* same thing, but no warning */
}

3.) Command Used : gcc 
----------------

4.) Files used :
--------------
		tm.h          -> tm-sparc.h
		md            -> sparc.md
      config.h      -> xm-sunos4.h
      aux-output.c  -> output-sparc.c
      
5.) Machine(s) used :
-------------------
   Sun 4 running Sun4.0

6.) Compiler diagnostics :
------------------------

gcc version 1.32
 /usr/public/lib/gcc/gcc-cpp -v -I/cd/ua/schmidt/include/ -undef
-D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__
test.c /tmp/cca03510.cpp
GNU CPP version 1.32
 /usr/public/lib/gcc/gcc-cc1 /tmp/cca03510.cpp -quiet -dumpbase test.c
-fstrength-reduce -finline-functions -version -o /tmp/cca03510.s
GNU C version 1.32 (sparc) compiled by GNU C version 1.32.
test.c: In function main:

test.c:4: warning: address requested for `foo', which is declared `register'
Technical Details
Message-ID: <8901141647.aa00666@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!POMPE.ICS.UCI.EDU!schmidt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!POMPE.ICS.UCI.EDU!schmidt
From: schmidt@POMPE.ICS.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.gcc.bug
Subject: gcc 1.32 give potentially spurious warning?
Message-ID: <8901141647.aa00666@PARIS.ICS.UCI.EDU>
Date: 15 Jan 89 00:39:06 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 49