Questions tagged [compiler-warnings]

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

Compiler warnings typically flag patterns in code that could potentially cause problems, but for lack of context the compiler cannot declare absolutely that the code is flawed.

2652 questions
1
vote
1 answer

Can't perform a React state update on an unmounted component with react-router-dom links

I have a Sidenav component that takes in props. These props are then being used to render the custom sidenav for the page it's used on. Everything works, but when clicking on one of the links in the browser, this warning pops up: It still redirects…
1
vote
1 answer

GCC 11 false array subscript is partly outside array bounds warning

Been struggling with a false warning on switching from GCC 10.2 to GCC 11 and I'm looking for a workaround. char* const dest = data_.data(); if (src.length() > max_chars) { // does not fit, copy first max_chars…
haelix
  • 4,245
  • 4
  • 34
  • 56
1
vote
2 answers

Hudson and build warnings: possible to exclude a project from reporting?

I'd like Hudson to send an e-mail to developers whenever a warning is encountered in the build (VS2010, TFS) The problem is that the solution contains several projects from another company that we cannot touch. Since they are part of the solution,…
1
vote
1 answer

The component styled.p with the id of "sc-iseJRi" has been created dynamically

Good evening everyone, I need some help. I can't solve a warning: Keyframes.js:20 The component styled.p with the id of "sc-iseJRi" has been created dynamically. You may see this warning because you've called styled inside another component. To…
1
vote
1 answer

How to suppress snprintf() warning 'directive writing up to xx bytes...'

I'm using snprintf() to write string into a buffer. #define MAXLEN 256 char line[MAXLEN]; char buf[MAXLEN]; snprintf(buf, sizeof(buf), "Hi%s", line); When compiling, it shows warning directive writing up to 256 bytes into a region of size 254 Any…
code_worker
  • 384
  • 3
  • 16
1
vote
1 answer

How to deal with Visual Studio's warning C6011 after using realloc?

I am following Microsoft's guidelines on how to work around this warning but it doesn't seem to work. I add all the checks but, when I copy the 'expanded' pointer tmp to ptr and try to use it, I get another warning: Warning C6200 Index '1' is out…
Andrés Sanchez
  • 99
  • 1
  • 10
1
vote
1 answer

gcc optimization affects bounds checking

Consider the following example: int a[4]; int main() { a[4] = 12; // <-- return 0; } This is clearly an out of bounds error, is it not? I was wondering when gcc would warn about this, and found that it will only do so if optimisation is -O2 or…
bitmask
  • 32,434
  • 14
  • 99
  • 159
1
vote
0 answers

Is there a way to get clang to report a diagnostic for old style (K&R) definitions?

I am working on a legacy C code base which includes a mix of old (K&R) style and new (ANSI) style definitions. The plan is to gradually remove all the old style definitions and replace them with new style. To help in progressing this plan, I'd like…
Simon Kissane
  • 4,373
  • 3
  • 34
  • 59
1
vote
2 answers

C++ not sure how to fix C4018 unsigned int mismatch

relatively new to C++ and I'm having issues getting my code going. When I compile and run the program the terminal window is just black, but I noticed 3 warnings I have might be causing this issue, however I'm not sure how to clear them up. The…
1
vote
1 answer

PhpStorm inspect tool giving inconsistent results (different number of errors/warnings on sequential runs)

Trying to use PhpStorm inspect to tell a story of our code quality and track improvements. It's working well and I have a script that daily pulls from git, runs the inspection and graphs everything. Yay. Here's the key line that runs the…
Mark Mayo
  • 12,230
  • 12
  • 54
  • 85
1
vote
1 answer

SCSS is breaking my grid when converting to CSS- IE prefixes

I'm having trouble with a misbehaving grid. For context, I have a single page application that I am trying to turn into a grid-layout at large screens. My HTML has a div of "main-grid" that wraps the entire page:
1
vote
1 answer

Subtle Compiler Warning in SBCL When Compiling a Lambda Expression

I'd like some help with understanding an SBCL compiler warning message, which occurs when compiling a lambda expression. The lambda expression is temporarily stored as the symbol-value of a user-defined name, and the compiled function is…
davypough
  • 1,847
  • 11
  • 21
1
vote
0 answers

Warning C4866 raised by Microsoft Visual C++

I have some class that can receive things using an overloaded << operator, and also accept some settings - conveniently applied by methods returning *this so this can be chained. However, on Microsoft Visual C++ (latest) with /std:c++latest the…
schroder
  • 181
  • 1
  • 3
1
vote
1 answer

//usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: error adding symbols: DSO missing from command line

make powerdns it give error don't know how to resolve it error CXX epollmplexer.o CXXLD dnsdist /usr/bin/ld: libssl.o: undefined reference to symbol 'CRYPTO_get_ex_new_index@@OPENSSL_1_1_0' //usr/lib/x86_64-linux-gnu/libcrypto.so.1.1:…
1
vote
0 answers

Warn on unused result

According to the clang docs I am seeing that warn on unused result should be enabled by default. But, it doesn't seem to work unless I use the function __attribute__((warn_unused_result)). Example: int foo(void); doesn't trigger an unused result…