[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] Cycling pound includes check?
|
Hi,
it is legal and quite normal to include the same file in a
translation unit mor than once. Issuing a warning about
it
would not be the right thing to
do.
Neither a
compiler nor a parser has
a reasonable way to check whether a
recursive inclusion is handled
properly
within the
header. It just has to perform the inclusion and typically aborts the process at
a certain recursion depth.
Markus.
I have been hit several times lately with cycling pound includes in
the code and unfriendliness of the compiler regarding the issues like that.
The error shows up at the strange place and it takes a while to trace it down
just to find out that someone included a header file that had it already
included before.
Since CDT tells me right away if I have included
header file that doesn't exist, could this circular check be added as well.
From the high level it doesn't seem hard to do so, but things could be
different down below.
Let me
know!
Thanks.
Fedja