What is the reason for the -Wlong-long
gcc warning?
From the gcc man page:
-Wlong-long Warn if long long type is used. This is enabled by either -Wpedantic or -Wtraditional in ISO C90 and C++98 modes. To inhibit the warning messages, use -Wno-long-long.
As I understand it, long long
is required to be at least 64-bits (practically it is always 64-bits, at least with today's compilers). Was this not the case for ISO C90 or C++98, or is there some other reason not to use long long
?
I know about <stdint.h>
types like int64_t
and friends, but some not-so-old compilers (e.g. VS2005, and Green Hills ARM 3.5) do not provide <stdint.h>
, and I thought long long
would be (at least) 64 bits for those and newer toolchains.
To answer your question about disabling specific warnings in GCC, you can enable specific warnings in GCC with -Wxxxx and disable them with -Wno-xxxx. From the GCC Warning Options: You can request many specific warnings with options beginning -W , for example -Wimplicit to request warnings on implicit declarations.
Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky or suggest there may have been an error. The following language-independent options do not enable specific warnings but control the kinds of diagnostics produced by GCC.
Maybe you can look for CFLAGS options in Makefile and remove the -Werror flag. The Werror flag will make all warnings into errors. Show activity on this post. In general, it is not a good idea to ignore warnings from your compiler.
gcc -Wall enables all compiler's warning messages. This option should always be used, in order to generate better code.
There was no long long
type yet in ISO C90 and C++98. It has only been added in ISO C99 and C++11.
GCC provided it as an extension prior to standardization, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With