Skip to content

Update to build with gcc 13 #293

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

Closed
maks opened this issue Jan 6, 2025 · 6 comments · Fixed by #446
Closed

Update to build with gcc 13 #293

maks opened this issue Jan 6, 2025 · 6 comments · Fixed by #446
Assignees
Labels
engineering Work needed for building or working on the project, eg CI/CD
Milestone

Comments

@maks
Copy link
Collaborator

maks commented Jan 6, 2025

We now only need to fix a couple function signatures once we update to get current master branch to new dependencies to then get it to build with gcc 13 so we should upgrade to do this and build with gcc13 on CI once the dependencies like sdfat are updated.

@maks maks self-assigned this Jan 6, 2025
@maks maks added the engineering Work needed for building or working on the project, eg CI/CD label Jan 6, 2025
@maks maks added this to the 2.1 milestone Feb 27, 2025
@maks maks modified the milestones: 2.1, 2.2 Mar 31, 2025
@faithanalog
Copy link
Contributor

faithanalog commented Apr 7, 2025

I am building on gcc14 with these changes:

diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt
index 332c118..2d502b6 100644
--- a/sources/CMakeLists.txt
+++ b/sources/CMakeLists.txt
@@ -70,6 +70,9 @@ add_compile_options(
   -Wno-array-bounds
 )
 
+add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-overloaded-virtual>)
+add_compile_options($<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-aggressive-loop-optimizations>)
+
 add_subdirectory(Adapters)
 add_subdirectory(UIFramework)
 add_subdirectory(System)
diff --git a/sources/Foundation/T_Factory.h b/sources/Foundation/T_Factory.h
index 9bc2b03..49b0f89 100644
--- a/sources/Foundation/T_Factory.h
+++ b/sources/Foundation/T_Factory.h
@@ -9,7 +9,7 @@
 
 template <class Item> class T_Factory {
 protected:
-  virtual ~T_Factory<Item>(){};
+  virtual ~T_Factory(){};
 
 public:
   // Install the factory to use

I do not remember what code exactly triggers those two warnings but it was only a couple spots, i just wasn't sure what to do to fix them so I disabled them.

@maks
Copy link
Collaborator Author

maks commented Apr 8, 2025

@faithanalog Thanks! I'll see if I can find get this incorporated in soon so that we can move to building with gcc13 or even better with gcc14

@maks
Copy link
Collaborator Author

maks commented Apr 8, 2025

@faithanalog Thanks for the prompting for me to get a move on with this 👍🏻

I've got a PR with a branch that now builds with GCC13: #446
and hopefully fixes the issue you had fixes for for GCC14 but I don't have GCC14 installed so if you could try it out and see if it works for you that would be great 🙏🏻

@faithanalog
Copy link
Contributor

that seems to take care of pretty much everything except the opal warning

In file included from /tmp/picoTracker/sources/Externals/opal/opal.cpp:1:
In member function ‘void Opal::Channel::SetChannelPair(Opal::Channel*)’,
    inlined from ‘void Opal::Port(uint16_t, uint8_t)’ at /tmp/picoTracker/sources/Externals/opal/opal.cpp:252:34:
/tmp/picoTracker/sources/Externals/opal/opal.h:141:54: error: iteration 1 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
  141 |     void SetChannelPair(Channel *pair) { ChannelPair = pair; }
      |                                          ~~~~~~~~~~~~^~~~~~
/tmp/picoTracker/sources/Externals/opal/opal.cpp: In member function ‘void Opal::Port(uint16_t, uint8_t)’:
/tmp/picoTracker/sources/Externals/opal/opal.cpp:238:25: note: within this loop
  238 |       for (int i = 0; i < 6; i++, mask <<= 1) {
      |                       ~~^~~

I really could not make sense of what the problem is that needs to be fixed, the code is a bit convoluted to me

@maks
Copy link
Collaborator Author

maks commented Apr 8, 2025

@faithanalog thanks again for testing this out. I couldn't reproduce the issue after I installed and build with GCC 14.2 but just in case I pushed up a small change that should disable that warning for just the OPAL directory. If you could please let me know if that works for you and I will then look to get our CI updated to at least GCC13 and the PR merged.

@faithanalog
Copy link
Contributor

@maks yup, it now builds for me now!

@maks maks closed this as completed in #446 Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Work needed for building or working on the project, eg CI/CD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants