Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Tibor Áser Veres
Sat, 04 Jun 2022 15:57
possible -Wunused-variable bug
Author: Tibor Áser Veres
Date: Sat, 04 Jun 2022 15:57
Date: Sat, 04 Jun 2022 15:57
67 lines
4326 bytes
4326 bytes
Hi!
I'm new here, and in the process of learning c++. Not sure where should I report bugs... for g++ compiler.
When I enabled -Wunused I'm getting these warnings:
In file included from /media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HexaLib-GUI.h:23,
from /media/LocalDrives/SSD/Programs/HydraFort/Source/Main.cpp:2:
/media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HLGlobals.h:17:33: warning: ‘HexaLib::AMask’ defined but not used [-Wunused-variable]
17 | static uint32_t AMask = 0xff000000;
| ^~~~~
/media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HLGlobals.h:16:33: warning: ‘HexaLib::BMask’ defined but not used [-Wunused-variable]
16 | static uint32_t BMask = 0x00ff0000;
| ^~~~~
/media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HLGlobals.h:15:33: warning: ‘HexaLib::GMask’ defined but not used [-Wunused-variable]
15 | static uint32_t GMask = 0x0000ff00;
| ^~~~~
/media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HLGlobals.h:14:33: warning: ‘HexaLib::RMask’ defined but not used [-Wunused-variable]
14 | static uint32_t RMask = 0x000000ff;
| ^~~~~
In file included from /media/LocalDrives/SSD/Programs/HydraFort/HexaLib/HexaLib.h:23,
from /media/LocalDrives/SSD/Programs/HydraFort/Source/../HexaLib-GUI/HexaLib-GUI.h:22,
from /media/LocalDrives/SSD/Programs/HydraFort/Source/Main.cpp:2:
/media/LocalDrives/SSD/Programs/HydraFort/HexaLib/HexaLog.h:28:21: warning: ‘HexaLib::AppendFile’ defined but not used [-Wunused-variable]
28 | static bool AppendFile = false;
| ^~~~~~~~~~
/media/LocalDrives/SSD/Programs/HydraFort/HexaLib/HexaLog.h:26:25: warning: ‘HexaLib::TraceFocus’ defined but not used [-Wunused-variable]
26 | static uint16_t TraceFocus = 0; // 0 = Silent, Trace>0 = focus that trace, 65535 = Default trace(if no Trace specified...)
| ^~~~~~~~~~
/media/LocalDrives/SSD/Programs/HydraFort/HexaLib/HexaLog.h:25:21: warning: ‘HexaLib::LogLevel’ defined but not used [-Wunused-variable]
25 | static char LogLevel = 'I'; // 'S' = Silent, 'E' = Errors, 'W' Errors and Warnings, 'I' = Errors, Warnings, and Info 'D' everything including debug messages.
| ^~~~~~~~
I checked all of those variables are used, and my program works just fine. In fact if I remove any of them I get errors instead...
The common thing about them is that they are all static global variables, within the HexaLib namespace.
Here's the g++ version:
g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads