gtk2xtbin.c:478:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement ]

RESOLVED FIXED in mozilla20

Status

()

Core
Widget: Gtk
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla20
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Filing bug on build warning:
{
widget/gtkxtbin/gtk2xtbin.c:478:5: warning: ISO C90 forbids mixed declarations and code [-pedantic]
}

This is in code added for bug 544088.
(Assignee)

Comment 1

5 years ago
Created attachment 688883 [details] [diff] [review]
fix

Trivial fix -- just declare the variable at the beginning of the block.  I also fixed up some whitespace oddness in contextual code.
Attachment #688883 - Flags: review?(karlt)
The change looks fine, but mixed declarations are permitted in C99.
Would it make more sense to add -Wno-declaration-after-statement?
See -Wdeclaration-after-statement at http://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/Warning-Options.html
Comment on attachment 688883 [details] [diff] [review]
fix

Oh, I see bug 659707 and it is not worth playing with flags in non-MSVC code.
Attachment #688883 - Flags: review?(karlt) → review+
Blocks: 659707
Summary: gtk2xtbin.c:478:5: warning: ISO C90 forbids mixed declarations and code [-pedantic] → gtk2xtbin.c:478:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement ]

Comment 5

5 years ago
https://hg.mozilla.org/mozilla-central/rev/326520e22222
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.