Bug 35482

Summary: make some more dangerous warnings errors by default
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: gcc8Assignee: Gleb F-Malinovskiy <glebfm>
Status: NEW --- QA Contact: qa-sisyphus
Severity: enhancement    
Priority: P3 CC: glebfm, iv
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2018-10-07 06:16:50 MSK
Some warnings concerning pointers mean that a dangerous thing can happen (the pointer value can be corrupted), and this will be difficult to debug and to reproduce.

The first of such warnings is:

* "implicit declaration of function" (example: https://bugzilla.altlinux.org/show_bug.cgi?id=34977#c0 )

I suggest to make this warning an error by default.

There are some other dangerous warning (though, sometimes this code is intentional). A second such warning is:

* "cast from pointer to integer of different size" (example: http://git.altlinux.org/tasks/archive/done/_209/214230/build/100/x86_64/log ; this case actually needs to be fixed by casting to an int type that has the same size as a pointer, e.g. "intptr_t" or OCaml specific "value", which is defined according to the same idea)

It is rarely something that people actually want. Perhaps, this warning could also be made an error by default.

As for a third warning, it is not so dangerous, and such code can be error-free more often than the other warnings:

* "passing argument ... from incompatible pointer type" (example: https://bugzilla.altlinux.org/show_bug.cgi?id=34977#c0 ; there, it works correctly, although the compiler doesn't know this; it could be corrected with an explicit cast, although that might be too much work)

As for the third warning, I'm not so sure that it should be made an error by default.

Perhaps, there are more dangerous warnings which I couldn't remember now.