Mailinglist Archive: opensuse-bugs (5295 mails)

< Previous Next >
[Bug 849747] New: gcc -Wredundant-decls can warn when declaration isn't redundant
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Sun, 10 Nov 2013 10:55:46 +0000
  • Message-id: <bug-849747-21960@http.bugzilla.novell.com/>

https://bugzilla.novell.com/show_bug.cgi?id=849747

https://bugzilla.novell.com/show_bug.cgi?id=849747#c0


Summary: gcc -Wredundant-decls can warn when declaration isn't
redundant
Classification: openSUSE
Product: openSUSE 12.2
Version: Final
Platform: x86-64
OS/Version: openSUSE 12.2
Status: NEW
Severity: Minor
Priority: P5 - None
Component: Other
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: aleph0hpela-suse@xxxxxxxxxxx
QAContact: qa-bugs@xxxxxxx
Found By: ---
Blocker: ---


Created an attachment (id=566782)
--> (http://bugzilla.novell.com/attachment.cgi?id=566782)
code with example output

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101
Firefox/24.0

If a variable is declared extern not at file level, and then used in another
scope also not at file level, it needs to be declared extern again. gcc warns
in this case. See attached example.

Seen in gcc-4_7-branch revision 189773


Reproducible: Always

Steps to Reproduce:
1. Copy gcc_main.c from attached example
2. Compile it with -Wredundant-decls
3. Examine output
4. Comment out alleged redundant declaration
5. Repeat compilation: it fails
Actual Results:
gcc_main.c:12:20: warning: redundant redeclaration of ‘foo’ [-Wredundant-decls]
gcc_main.c:8:20: note: previous declaration of ‘foo’ was here


Expected Results:
No warning

--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
< Previous Next >