You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[yes, this is a duplicate of #234 and #236. Those issues were closed due to testing on an entire codebase rather than minimal test cases first. I think it's worth giving them another shot, without that pollution.]
c.c depends indirectly on a.h. Technically sound, but a real pest for compilation. I propose a flag, -Windirect-header, to detect and warn for this.
The latter idea is self-explanatory. Unused headers may not be as big a pest for compilation, but they still clutter the code and make it harder to trace dependencies. I propose -Wunused-header for this.
So as not to pollute the compile log, such warnings would ideally be printed per header rather than per reference, i.e.:
WARN: File main.c depends on header aux.h via route.h [using symbols jackConnect, jackStatus]
WARN: File main.c depends on header usb.h via route.h [using symbols jackPoll, jackBroadcast]
...
A wrinkle in this idea is that many projects have "meta-headers", that is, header files that only serve to indirectly provide a lot of smaller headers in one. Indirect warnings via these, and unused warnings within them, are frivolous. A solution would be some way to mark such headers as transitive, for instance by --transitive janet.h,zmq.h, thus disabling all such warnings.
The text was updated successfully, but these errors were encountered:
[yes, this is a duplicate of #234 and #236. Those issues were closed due to testing on an entire codebase rather than minimal test cases first. I think it's worth giving them another shot, without that pollution.]
Consider the following files:
c.c
depends indirectly ona.h
. Technically sound, but a real pest for compilation. I propose a flag,-Windirect-header
, to detect and warn for this.The latter idea is self-explanatory. Unused headers may not be as big a pest for compilation, but they still clutter the code and make it harder to trace dependencies. I propose
-Wunused-header
for this.So as not to pollute the compile log, such warnings would ideally be printed per header rather than per reference, i.e.:
A wrinkle in this idea is that many projects have "meta-headers", that is, header files that only serve to indirectly provide a lot of smaller headers in one. Indirect warnings via these, and unused warnings within them, are frivolous. A solution would be some way to mark such headers as transitive, for instance by
--transitive janet.h,zmq.h
, thus disabling all such warnings.The text was updated successfully, but these errors were encountered: