Open mingodad opened 3 years ago
Also:
/home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:362:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
return NULL;
~~~~~~ ^~~~
false
/home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:368:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
return NULL;
~~~~~~ ^~~~
false
/home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:384:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
return NULL;
~~~~~~ ^~~~
false
...
/home/mingo/dev/c/A_programming-languages/jancy_b/jancy/src/jnc_ct/jnc_ct_OperatorMgr/jnc_ct_OperatorMgr_Closure.cpp:125:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion]
return NULL;
~~~~~~ ^~~~
false
Also:
/home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:362:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion] return NULL;
false /home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:368:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion] return NULL; ~~~~~~ ^~~~ false /home/mingo/dev/c/A_programming-languages/jancy_b/graco/src/Parser.cpp:384:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion] return NULL; ~~~~~~ ^~~~ false ... /home/mingo/dev/c/A_programming-languages/jancy_b/jancy/src/jnc_ct/jnc_ct_OperatorMgr/jnc_ct_OperatorMgr_Closure.cpp:125:10: warning: implicit conversion of NULL constant to 'bool' [-Wnull-conversion] return NULL; ~~~~~~ ^~~~ false
These are the duplicates of the previously fixed warnings. Pull the latest jancy_b
and these should be gone.
Regarding warning fixes -- I agree, "deep" warnings help to clean up certain bugs. However, could you elaborate on this one:
2 - Replace struct partial initiialization like timespec timespec = {0}; by timespec timespec = {}; also remove several noise warnings.
Not quite sure which warning it might cause?
Thing is, = {}
is less compatible than = {0}
(for example, MSVC has issues with it), so I would prefer to keep zero-initializers to remain in form of = {0}
and maybe fix the particular warnings in some other way...
Probably in cases like the one you mention using a macro that can be set to a value that eliminate the warning for other compilers, something like:
#ifdef _MSC_
#define STINIT 0
#else
#define STINIT
#endif
SomeStruct ss = {STINIT};
Adding
-Wall -Wextra
compiler flags there is a lot of noise warnings:1 - Instead of setting/comparing
size_t == -1
why not define a macro#define SIZE_ERROR MAX_SIZE
and use it to remove lots of noise warnings ?2 - Replace struct partial initiialization like
timespec timespec = {0};
bytimespec timespec = {};
also remove several noise warnings.3 - Remove the parameter names for function declarations that don't use then (
QtCaret::timerEvent (QTimerEvent* /*e*/)
) also remove a lot of noise warnings.4 - Several others like the above.
Then we can start seeing helpful compiler warnings like: