Skip to main content

Questions tagged [compiler-warnings]

Messages emitted by a compiler which indicate potential problems in code or configuration.

compiler-warnings
-2 votes
1 answer
86 views

Warning to discover unnamed variable

Recently I've met a bug in C++ project related to an unnamed scope guard, like in this question: LockGuard(mutex); See simple demo. This kind of bug is really hard to find by reviwing changes, and ...
Rom098's user avatar
  • 2,511
0 votes
0 answers
12 views

Alternatives to self assignment for 'breakpoint code'

I recently tried to build a project with clang and clang++. Up to now it has only been built with GCC. One of the problems that I saw was with code that is of the following form if (expression) { ...
Paul Floyd's user avatar
  • 6,357
1 vote
1 answer
31 views

Getting Warning BL0005 when modeling data for EditForm in Blazor

I am doing something like this in the Blazor HTML section... <EditForm EditContext="editContext" OnValidSubmit="SubmitQuery"> <DataAnnotationsValidator /> <...
Jbtatro's user avatar
  • 103
2 votes
2 answers
127 views

Understanding How the Compile Function Works in SBCL Common Lisp

I was hoping someone can explain why the compile function is not working as I would expect. First question: * (compile 'square (lambda (x) (* x x))) SQUARE NIL NIL But then: * (square 3) ; in: SQUARE ...
davypough's user avatar
  • 1,909
3 votes
0 answers
62 views

signed overflow warning when extracting/inserting a timepoint from/to streams

When specifying the command line options -Wstrict-overflow=4 and -O3, extracting a timepoint (e.g. std::chrono::local_seconds) from a stream object triggers some warnings from GCC (v14.1). Inserting a ...
digito_evo's user avatar
  • 3,582
0 votes
0 answers
13 views

EventHandler NRT annotation not recognized in *.designer.cs

Since NRT annotations of System.EventHandler the sender has to be nullable. If I define an event handler without correct sender declaration it will force an CS8622 error at event handler registration. ...
Sebastian Schumann's user avatar
0 votes
1 answer
67 views

Misleading unreachable warning when a type pattern match that is the result of a inline expansion is involved?

The following method works fine when T and the types of all its components are specific types (contrary to abstract type parameters). import scala.compiletime.* private inline def loop[T <: Tuple, ...
Readren's user avatar
  • 1,216
0 votes
1 answer
72 views

Cannot assemble my code: waring: warning: relocation in read-only section `.text', warning: creating DT_TEXTREL in a PIE

I tried to replicate the assembly workspace that i have to study on my windows pc (where i have instruction to how installe and use wsl) on my linux pc but when i try to assemble by using ./assemble....
Francesco Bonistalli's user avatar
0 votes
0 answers
71 views

Can I ask GCC to give me a warning or error on empty structs?

I just had the worst problem ever in my mixed C/C++ project. The C code is the production code, the C++ is the testing environment. We are compiling with MinGW GCC, but developing on Qt Creator which ...
Charles's user avatar
  • 1,163
1 vote
1 answer
113 views

Terraform Warning: Interpolation-only expressions are deprecated

I got this warning: Warning: Interpolation-only expressions are deprecated on best.tf line 69, in locals: 69: pools = length(var.instances) > 0 ? { "${var.name}" = var....
Positive Navid's user avatar
0 votes
0 answers
44 views

Windows CPP compiler ignore specific warnings and treat every warning as error

I am following this documentation I want to treat all warnings as error and ignore these specific warnings but I get an error: set _CL_="-WX -WD28020 -WD28112 -WD28132 -WD28159 -WD28182 -WD28195 -...
Node.JS's user avatar
  • 1,457
0 votes
0 answers
208 views

How does my system's GCC silence PSTL warnings?

When I compile even the simplest program using a C++ standard library algorithm execution policy, I get a page or two of warnings from include/c++/14.0.1/pstl/algorithm_impl.h - centred on the message ...
user2023370's user avatar
  • 10.9k
1 vote
2 answers
132 views

Being inundated with macro redefinition from ntstatus.h

Despite having added the #define, I am still receiving the same bunch of warnings, twice (as many times the below header is #included) for a total of 100+ warnings: #ifndef UMDF_USING_NTSTATUS #define ...
BusterZo's user avatar
1 vote
3 answers
94 views

GCC -Woverride-init warning with anonymous structs in a union

I need to define a type formed with 2 24-bit fields (48 bits in total). I didn't find a way to do it with bitfields in a struct. So I defined my type with a union and 2 anonymous structs : typedef ...
clem822's user avatar
  • 11
3 votes
1 answer
122 views

Missing GCC "-Wformat" warnings for "%p" with char* etc

If I compile the following code with -std=c17 -Wall -Wextra -Wpedantic with GCC 13.2.0, I get no warnings, despite not using void* in arguments corresponding to "%p" format specifiers. #...
Wolf's user avatar
  • 9,955

15 30 50 per page
1
2 3 4 5
182