This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
2) The implementation of #import will fail under certain circumstances and cause a file to be read twice when it shouldn't have been. This is also true of the #ifndef-wrapper optimization. However, when the #ifndef-wrapper optimization fails the only effect is a small amount of wasted time, because the #ifndef prevents the content of the header from being seen twice. #import failing causes the translation unit to be rejected spuriously.
3) #import is poor language design:
#import is not a well designed feature. It requires the users of
a header file to know that it should only be included once. It
is much better for the header file's implementor to write the
file so that users don't need to know this. Using a wrapper
#ifndef accomplishes this goal.
And I can't resist stating again that I think #include is poorly
designed.| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |