Bug 35482 - make some more dangerous warnings errors by default
Summary: make some more dangerous warnings errors by default
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: gcc8 (show other bugs)
Version: unstable
Hardware: all Linux
: P3 enhancement
Assignee: Gleb F-Malinovskiy
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-07 06:16 MSK by Ivan Zakharyaschev
Modified: 2018-11-26 15:37 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.