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
New compilation warnings with gcc 9.1.0 #17014
Comments
From @dur-randirCreated by @dur-randirI get the following warnings when building perl on Debian with gcc 9.1.0 Wformat-overflow: locale.c: In function ‘Perl__is_cur_LC_category_utf8’:
5092 | e); Wc++-compat (lots of, here's the pattern): byte_t.c:322:24: warning: uninitialized const ‘utf8_viscii’ is invalid Perl Info
|
From @hvdsOn Thu, 23 May 2019 02:23:48 -0700, randir wrote:
This one definitely looks like a bug, code was added by Karl in de3a307.
These I don't think we should care about, we explicitly use different code #ifdef __cplusplus. Hugo |
The RT System itself - Status changed from 'new' to 'open' |
From @dur-randirOn Thu, 23 May 2019 08:25:25 -0700, hv wrote:
They've enabled them by default, so should perl add -Wno-c++-compat (or whatever is it called)? |
From @hvdsOn Thu, 23 May 2019 08:25:25 -0700, hv wrote:
This was fixed in 01b9105. Hugo |
From @hvdsOn Thu, 23 May 2019 09:43:35 -0700, randir wrote:
I have little opinion on that, I know little about the use or intent of perl's C++ support. If it's possible, ideal would be to disable such warnings only within the ifndef __cplusplus branches: they're potentially useful elsewhere. Hugo |
As of Dec 8, the state of build-time warnings with gcc-9 looked like this:
Now, this was measured on FreeBSD-31 (I don't have gcc-9 available on my linuxes) with a threaded build. I can supply a list of all the specific warnings if so desired. I really would like to see the @khwilliamson , @hvds, @dur-randir , what can we do to make this happen? Thank you very much. |
Thinking further on this, as long as we're regularly building with C++ we get no additional value from C++-compat warnings when building in non-C++ mode. So I think disabling those warnings in C builds would be the right thing to do. Hugo |
The problem I see with simply turning a particular category of warnings off is that we would not thereafter be prompted to write source code with enough precision to cover different C-compilers. Rather than suppressing reporting of a problem, shouldn't we learn how to fix the problem (assuming it's actually possible to do so)? Thank you very much. |
Sorry, I don't think I understand your point. The warning is about C++-compatibility, but we handle C++-compatibility ourselves by having distinct code branches. Where we have two code branches, one for C compilers and the other for C++ compilers, we do not need the former to be C++-compatible. If we compile the code under g++ at the same version, we'll get all the C++-compatibility warnings that are useful to us. Those are the ones we should care about. Hugo |
@hvds Would you be able to supply an example of your suggested ("two-branch") approach would work with one of our source-code files?
Thank you very much. |
The "two-branch" approach is what we currently have anywhere we compile distinct code depending on Any code that is explicitly not compiled when __cplusplus is not defined is not expected to be C++-compatible, and it is not useful to get warnings that it is not. |
I now have gcc-9.3.0 available on Linux following an upgrade to Ubuntu 20.04 LTS. Here is the current status of build-time warnings on an unthreaded build on Linux with that C-compiler:
Thank you very much. |
Status unchanged as of commit 3e25f6d (Mar 21 2021). |
The status of build-time warnings when we compile with gcc-9 has changed since the last update to this ticket. This commit:
... introduced warnings in these categories:
If you compile with I have filed this ticket upstream: https://rt.cpan.org/Ticket/Display.html?id=136985 @leonerd, can you take a look? Thank you very much. |
Status unchanged as of 765cd54 (Feb 22 2022). |
With the merge of Encode 3.17 I believe we have no further gcc 9.1.0 warnings from -Wc++-compat, so I am closing this issue. |
This silences the build warnings reported in Perl#19588 and in Perl#17014. It includes some test updates, but no functionality changes.
Migrated from rt.perl.org#134130 (status was 'open')
Searchable as RT134130$
The text was updated successfully, but these errors were encountered: