Closed Bug 1393216 Opened 7 years ago Closed 7 years ago

When compiling for Windows with gcc, we encounter lots of #pragma warning's - which generate warnings

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

Details

(Whiteboard: [tor])

Attachments

(1 file)

MSVC supports #pragma warning() which is used to enable or disable warnings in a very nuanced way. https://msdn.microsoft.com/en-us/library/2c8f766e.aspx

gcc doesn't recognize these, and generates a warning saying 'Unknown Pragma'
Try run:  https://treeherder.mozilla.org/#/jobs?repo=try&revision=d3499293ef67ca1d4000f2f7f905a13fe55f44b4

(The build will break, but the log shouldn't have any 'ignoring #pragma warning')
Comment on attachment 8900451 [details]
Bug 1393216 Disable unknown pragma warnings when compiling for Windows with gcc

https://reviewboard.mozilla.org/r/171810/#review177048

r=me with the change below.

::: build/moz.configure/warnings.configure:112
(Diff revision 1)
>  # We use mix of both POSIX and Win32 printf format across the tree, so format
>  # warnings are useless on mingw.
>  check_and_add_gcc_warning('-Wno-format',
>                            when=depends(target)(lambda t: t.kernel == 'WINNT'))
>  
> +# When compiling for Windows with gcc, we hit lots of #pragma warning's which gcc does not recognize

Nit: maybe "...lots of "#pragma warning"s, which is an MSVC-only pragma thatn GCC does not recognize."  The quoting of "#pragma warning" is important here, I think.

(Note that we disable the warning on clang-cl too, for much the same reason.)
Attachment #8900451 - Flags: review?(nfroyd) → review+
Autoland can't push this until all pending issues in MozReview are marked as resolved.
Flags: needinfo?(tom)
Keywords: checkin-needed
Flags: needinfo?(tom)
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3dcae3969da1
Disable unknown pragma warnings when compiling for Windows with gcc r=froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3dcae3969da1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
No longer blocks: 1330608
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: