There will be some problem in the future to build OpenCPN with GCC16
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by reading gui/src/tcds_binary_harmonic.cpp, especially TCDS_Binary_Harmonic::LoadData around line 371, and inspect how num_csts is calculated before the allocation. Reproduce the GCC 16 build failure using the reported warning-as-error settings; check whether other files trigger the same warning. Done means OpenCPN builds without suppressing -Walloc-size-larger-than.
Written by the indexing model from the issue text.
Description
Hi
You may know that I am still building rpms of OpenCPN and its plugins for Mageia (Mageia10 now)
We are now preparing Mageia11 in Mageia Cauldron and I found something that may have an interest for you :
Building OpenCPN for Mageia10 is OK
But for Mageia Cauldron I get a failure with this explanation :
/builddir/build/BUILD/opencpn-5.14.2-build/OpenCPN-Release_5.14.2/gui/src/tcds_binary_harmonic.cpp: In member function 'virtual TC_Error_Code TCDS_Binary_Harmonic::LoadData(const wxString&)':
/builddir/build/BUILD/opencpn-5.14.2-build/OpenCPN-Release_5.14.2/gui/src/tcds_binary_harmonic.cpp:371:34: error: argument 1 range [18446744056529682432, 18446744073709551608] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
371 | m_cst_nodes = (double **)malloc(num_csts * sizeof(double ));
| ~~~~~~~~~~~~~~ ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/16/cstdlib:83,
from /usr/include/c++/16/ext/string_conversions.h:45,
from /usr/include/c++/16/bits/basic_string.h:4499,
from /usr/include/c++/16/string:58,
from /builddir/build/BUILD/opencpn-5.14.2-build/OpenCPN-Release_5.14.2/gui/src/ tcds_binary_harmonic.cpp:26:
/usr/include/stdlib.h:676:14: note: in a call to allocation function 'void malloc(size_t)' declared here
676 | extern void *malloc (size_t __size) __THROW attribute__malloc
| ~~~~~~~~~~~~~~^~~~~~
At global scope:
What might have caused this failure ?
mga10 has gcc-15 but Cauldron has gcc-16 which is more strict with Warnings considered as Errors
I have had to add :
export CFLAGS="%{optflags} -Wno-alloc-size-larger-than"
export CXXFLAGS="%{optflags} -Wno-alloc-size-larger-than"
before launching cmake and then OpenCPN could build
There may be something to change inside /gui/src/tcds_binary_harmonic.cpp
and perhaps in other cpp files (since I have suppressed those Werrors with my workaround I can't know if there are other causes of failure)
I attach the spec file I used (I needed to add a .txt extension to upload it here
opencpn.spec.txt
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 627
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenCPN/OpenCPN
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
OpenCPN/OpenCPN#5413 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Include git commit hash in version information for builds in local workspaceMay be free again A pull request for this issue was closed without being merged. Openenhancement
Difficulty 1/5 Under an hour Newbie friendliness 70/100
OpenCPN/OpenCPN#4753 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
RFE: Tide dialog for route point ETA.Possibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenCPN/OpenCPN#4422 · 3 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
contrib/ivorysql_ora/src/builtin_packages/utl_file/utl_file.c:517 - FCOPY destroys a file when source and destination are the samePossibly taken @Metastarx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
ly05010419/MacNativeGames#1848 ·
Maintainers usually reply within 1 day
-
libc++ test-suite
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
llvm/llvm-project#239851 ·
Maintainers usually reply within 1 day