OSX compiler warnings #100
aristocratos
started this conversation in
General
Replies: 2 comments
-
11. I had that warning too, but now it doesn't show up anymore :-/. No idea why.
It's quite normal, we can only put 1 digit, but an int can have many more. Not directly an idea how to avoid.
… On 18 Oct 2021, at 11:02, aristocratos ***@***.***> wrote:
@joske <https://github.com/joske>
Hey, are you compiling with gcc 10 or 11?
Because I'm gettings compiler warnings from smc.cpp on gcc 11:
PLATFORM ?| OSX
ARCH ?| arm64
CXX ?| g++-11 (11.1.0)
THREADS :| 8
REQFLAGS !| -std=c++20
WARNFLAGS :| -Wall -Wextra -pedantic
OPTFLAGS :| -O2 -ftree-loop-vectorize -flto=8
LDCXXFLAGS :| -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fexceptions -framework IOKit -framework CoreFoundation
CXXFLAGS +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
LDFLAGS +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
Building btop++ (v1.0.16) OSX arm64
Compiling src/btop_input.cpp
Compiling src/btop_tools.cpp
Compiling src/btop_draw.cpp
Compiling src/btop_config.cpp
Compiling src/btop.cpp
Compiling src/btop_menu.cpp
Compiling src/btop_theme.cpp
Compiling src/osx/btop_collect.cpp
-> obj/btop_tools.o (1.4MiB) (05s)
Compiling src/osx/sensors.cpp
-> obj/btop_input.o (1.6MiB) (06s)
-> obj/btop_theme.o (1.6MiB) (06s)
-> obj/btop_config.o (1.6MiB) (06s)
Compiling src/osx/smc.cpp
src/osx/smc.cpp: In member function 'Cpu::SMCConnection::getTemp(int)':
src/osx/smc.cpp:63:45: warning: '%1d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=]
63 | snprintf(key, 5, "TC%1dc", core);
| ^~~
src/osx/smc.cpp:63:42: note: directive argument in the range [0, 2147483647]
63 | snprintf(key, 5, "TC%1dc", core);
| ^~~~~~~~
src/osx/smc.cpp:63:33: note: 'snprintf' output between 5 and 14 bytes into a destination of size 5
63 | snprintf(key, 5, "TC%1dc", core);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
-> obj/osx/smc.o ( 28KiB) (01s)
-> obj/btop.o (2.1MiB) (07s)
-> obj/btop_menu.o (2.3MiB) (08s)
-> obj/osx/sensors.o (1.1MiB) (03s)
-> obj/osx/btop_collect.o (3.2MiB) (11s)
-> obj/btop_draw.o (2.7MiB) (11s)
Linking and optimizing binary...
-> bin/btop (1.1MiB) (04s)
Build complete in (16s)
Have you seen this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#100>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEB7RYEV4LHZUQ6QF5EBFLUHPPBJANCNFSM5GGC6A3Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Added |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@joske
Hey, are you compiling with gcc 10 or 11?
Because I'm gettings compiler warnings from
smc.cpp
on gcc 11:Have you seen this?
Beta Was this translation helpful? Give feedback.
All reactions