Closed Bug 818611 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: Widget: Gtk, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
Attached patch fixSplinter Review
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 ]
https://hg.mozilla.org/mozilla-central/rev/326520e22222
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.