Skip to content

Conversation

@lmamane
Copy link
Contributor

@lmamane lmamane commented Nov 3, 2024

which is an error since we compile with -Werror

which is an error since we compile with -Werror
@github-actions
Copy link

github-actions bot commented Nov 3, 2024

Build size and comparison to main:

Section Size Difference
text 374512B -16B
data 948B 0B
bss 63488B 0B

@mark9064 mark9064 added the maintenance Background work label Nov 18, 2024
Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An annoying g++ bug indeed

@mark9064 mark9064 added this to the 1.16.0 milestone Nov 24, 2024
@TheGreatMcPain
Copy link

I ran into this one as well.

/home/myswamp/git-repos/pinetime/InfiniTime/src/displayapp/screens/Navigation.cpp:194:15: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
  194 |   const auto& image = GetIcon("flag");
      |               ^~~~~

Had to add this.

diff --git a/src/displayapp/screens/Navigation.cpp b/src/displayapp/screens/Navigation.cpp
index ee9f2a00..01e14209 100644
--- a/src/displayapp/screens/Navigation.cpp
+++ b/src/displayapp/screens/Navigation.cpp
@@ -191,7 +191,10 @@ namespace {
  *
  */
 Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navService(nav) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-reference"
   const auto& image = GetIcon("flag");
+#pragma GCC diagnostic pop
   imgFlag = lv_img_create(lv_scr_act(), nullptr);
   lv_img_set_auto_size(imgFlag, false);
   lv_obj_set_size(imgFlag, 80, 80);

It's not exactly a "spurious warning", but it does happen in GCC14 for me.

@mark9064
Copy link
Member

mark9064 commented Jan 1, 2025

That one can be resolved by modernising the type of icon

-  Icon GetIcon(const std::string& icon) {
+  Icon GetIcon(std::string_view icon) {

Nonetheless it is a spurious warning (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114220)

@mark9064
Copy link
Member

mark9064 commented Jan 1, 2025

Also, the bounds warning bug disappears with LTO enabled. Intriguing

@NeroBurner NeroBurner merged commit c0638c6 into InfiniTimeOrg:main Mar 14, 2025
JustScott pushed a commit to JustScott/InfiniTime that referenced this pull request Jul 29, 2025
…#2158)

which is an error since we compile with -Werror

Co-authored-by: Lionel Elie Mamane <lionel@mamane.lu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Background work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants