[Scons-dev] Question on adding .C suffix to CXXSuffixes

Mats Wichmann mats at wichmann.us
Wed Jun 17 18:33:13 EDT 2020


On 6/17/20 4:03 PM, Don Baldwin wrote:
> Hi,
> 
>  
> 
> I noticed the following code in …/scons/SCons/Tool/cxx.py
> 
>  
> 
> CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
> 
> if SCons.Util.case_sensitive_suffixes('.c', '.C'):
> 
>     CXXSuffixes.append('.C')
> 
>  
> 
> Is this a bug?  Why are we adding ‘.C’ to CXXSuffixes when we haven’t
> added ‘.c’?

lowercase .c conventionally refers to C sources, so it shouldn't be
added to the list of lowercase suffixes for C++ files. uppercase .C
conventionally refers to C++ source, although it's very old and rarely
seen now - my memory is that was the first suffix, used back in the days
when the original C++ implementation was a translator to C, not a
compiler. (My memory is certainly not infallible... the net should have
more answers)

the conditional is so as not to add this on systems (Windows) where you
can't tell the difference between .c and .C.




More information about the Scons-dev mailing list