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]

Re: FSF GCC, #import and #pragma once


Although possibly irrelevant, given the spirit of compromise; it seems
as incorrect to conjecture the logical equivalence of two or more uniquely
named files based on the equivalence of their content, as it would be to
conjecture the equivalence to two or more pointers based on the equivalence
of the values they point to.

Personally, I would expect given:

#import "a"
#import "b"

that both "a" and "b" files would be processed, regardless of the
equivalence of their content (or even possibly aliased equivalence);
as since #import is logically evaluated in a lexical pre-processing
stage, it implies to me that the semantic equivalence of two or more
file specifications would correspondingly determined by the lexical
equivalence of their matching specified path/names. (where the matching
specified path/name is the lexical concatenation of the first matching
search path found containing a file specified by the #import path/name
string).

(although having a very low probability, I'd hate to be trying to debug a
problem caused by two unrelated files hashing to the same value, thereby
inhibiting the second from being properly imported. Are two or more files
distinct or not if they hash to the same value, yet have unique lexical
path/names? To me file references are intended to be unique if their
matching specified path/names are unique, regardless of the equivalence of
their content.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]