Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings with g++ 8.2.0 #1105

Closed
nlslatt opened this issue Apr 4, 2019 · 7 comments
Closed

Warnings with g++ 8.2.0 #1105

nlslatt opened this issue Apr 4, 2019 · 7 comments

Comments

@nlslatt
Copy link

nlslatt commented Apr 4, 2019

Compiling using g++ 8.2.0 with -Wall -Wshadow -pedantic results in -Wshadow and -Wdangling-else warnings. For me personally, the most critical to be remedied are the three distinct -Wshadow warnings coming from include/fmt/ostream.h (lines 25, 75, and 89) on the master branch.

build.log

@nlslatt
Copy link
Author

nlslatt commented Apr 4, 2019

Correction, there are four coming from ostream.h. The final one is on line 105.

@vitaut
Copy link
Contributor

vitaut commented Apr 7, 2019

Thanks for reporting this. Shadowing warnings are very noisy and in general have zero value which is why they are disabled by default (even with -Wall) when compiling {fmt} and are explicitly disabled in https://github.com/fmtlib/fmt/blob/master/include/fmt/format.h#L71.

Also this diagnostics looks like a bug in gcc, please report there:

/home/nlslatt/tmp/fmt/include/fmt/core.h:131:33: warning: declaration of ‘buffer’ shadows a global declaration [-Wshadow]
 #  define FMT_DETECTED_NOEXCEPT noexcept
                                 ^~~~~~~~

@vitaut vitaut closed this as completed Apr 7, 2019
@nlslatt
Copy link
Author

nlslatt commented Apr 8, 2019

If the shadow warnings are supposed to be explicitly disabled, then that feature does not appear to be working. When I #include fmt headers in my own build, I get more than 600 shadow warnings originating in fmt.

@vitaut vitaut reopened this Apr 8, 2019
@vitaut
Copy link
Contributor

vitaut commented Apr 8, 2019

Sorry, I must have misunderstood the issue. Looking at the logs I saw you are building {fmt} itself with shadowing warnings enabled.

@nlslatt
Copy link
Author

nlslatt commented Apr 8, 2019

I sent a log from building fmt directly because my code is not publicly available. I use fmt as header-only within my code. The shadow warnings I'm seeing in my code all originate from fmt's ostream.h.

@vitaut
Copy link
Contributor

vitaut commented Apr 9, 2019

Should be fixed in 2808395 and 718f60a.

@vitaut vitaut closed this as completed Apr 9, 2019
@nlslatt
Copy link
Author

nlslatt commented Apr 9, 2019

Yes, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants