🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #568

Gnu C compiler version 1.35 gives odd "unused" message

#568
From: Arthur David Olson
Date: Sat, 02 Sep 1989 20:10
41 lines
1776 bytes
(We're running SunOS 4.0.3 on a Sun 3/280.)

Description:
	If a static function is (incorrectly) declared after the first time it
	is called, gcc gives both a correct "was declared implicitly `extern'
	and later `static'" diagnostic and an incorrect "defined but not used"
	diagnostic (if the -Wunused flag is used).

Repeat-By:
	Script started on Sat Sep  2 16:08:30 1989
	elsie$ cat try.c
	int
	main()
	{
		return func();
	}

	static int
	func()
	{
		return 0;
	}
	elsie$ /usr/local/bin/gcc -v -Wunused try.c
	gcc version 1.35
	 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wunused -D__HAVE_68881__ -Dmc68020 try.c /tmp/cca16144.cpp
	GNU CPP version 1.35
	 /usr/local/lib/gcc-cc1 /tmp/cca16144.cpp -quiet -dumpbase try.c -Wunused -version -o /tmp/cca16144.s
	GNU C version 1.35 (68k, MIT syntax) compiled by GNU C version 1.35.
	try.c: In function func:
	try.c:9: warning: `func' was declared implicitly `extern' and later `static'
	try.c: At top level:
	try.c:9: warning: `func' defined but not used
	 as -mc68020 -o try.o /tmp/cca16144.s
	 ld -e start -dc -dp /lib/crt0.o /lib/Mcrt1.o try.o /usr/local/lib/gcc-gnulib -lc
	elsie$ a.out
	elsie$ exit

	script done on Sat Sep  2 16:08:49 1989
-- 
	Arthur David Olson    ado@alw.nih.gov    ADO is a trademark of Ampex.
Technical Details
Message-ID: <8909022010.AA16196@elsie>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ALW.NIH.GOV!elsie!ado

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ALW.NIH.GOV!elsie!ado
From: elsie!ado@ALW.NIH.GOV (Arthur David Olson)
Newsgroups: gnu.gcc.bug
Subject: Gnu C compiler version 1.35 gives odd "unused" message
Message-ID: <8909022010.AA16196@elsie>
Date: 2 Sep 89 20:10:14 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 41