tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: discussion seeked for c++ variants in USE_LANGUAGES



Le 12/11/15 14:46, Greg Troxel a écrit :
> 
> Richard PALO <richard%netbsd.org@localhost> writes:
> 
>> Again, I'd like to update clang.mk making c99, c11 and c++11 use the
>> same -std=gnu* as gcc.mk.  I wonder if perhaps adding -Wpedantic is
>> worthwhile.
> 
> I don't see why this is reasonable.  Programs should be written to
> standards, not gcc extensions.   It may be that we should have a
> package-settable variable to note that the package is in gnu c dialect
> instead of a standard one.  Or that may be tilting at windmills.
> 
> The other quesion is what packages are failing to build under clang due
> to not having this, but do with it, and how many of them are there?
> 
>> It would be trivial to add, if deemed usefule, a package settable
>> variable such as GCC_STRICT_ANSI to force -std={c99,c11,c++11} instead
>> of the gnu extension variant.
> 
> At first glance, I think that's backwards.
> 
> But we need to understand which packages have issues, what kind, and how
> many.
> 


It would be (for c99) trivial to test, change to one line in gcc.mk
I only run bulk for about 1200 packages so a full bulk run would be more useful.

I must say, with respect to c++11, currently most packages have hardcoded
CXXFLAGS+= -std=c++11, so I imagine that avoids the question there already.

Joerg seemed to think the following:
>>> The other consideration is whether the language standard should be
>>> gnuc++11 or c++11.
>>
>> Has anybody tried changing the c99 defaults from 'gnu99' to 'c99' to
>> see what blows (like during a bulk build)?
> 
> Very likely a lot, both due to disabled GNU extensions and the
> additional restrictions in the C namespace.

Personally, I'd simply like clang and gcc to use the same -std= clause 
to simplify pkgsrc maintenance. Today that's not the case for c99 already.

I'll give gcc with -std=c99 instead of -std=gnu99 a try just for grins.

-- 
Richard PALO



Home | Main Index | Thread Index | Old Index