tech-kern archive

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

Re: NULL pointer arithmetic issues



On 24.02.2020 14:03, Mouse wrote:
>>>> It is now in C++ mainstream and already in C2x draft.
>>> Then those are not suitable languages for OS implementations.
>> This battle is lost for C
> 
> C is not a language.  C is a family of closely related languages.
> 

If we tread C as gnu89 gnu99 gnu11 k&r etc this is true.

> Some of them are suitable for OS implementation.  It appears some of
> the more recent ones are not, but this does not mean the older ones 
> also aren't.
> 

From my perception the trend is inversed. Things that were undefined or
unspecified in older revisions of C, are more clearly defined now.

> Undefined behaviour as a way of describing differences between
> implementations, things that it limits portability to depend on, is
> useful.  Undefined behaviour as a license-by-fiat for compilers to
> unnecessarily transform code in unexpected ways is not.  Software
> languages and their compilers exist to serve their users, not the other
> way around; it is not a compiler's place to take the position of "ha
> ha, the code you wrote is clear but I can find a way to lawyer it into
> formally undefined behaviour, so I'm going to transform it into
> something I know damn well you didn't expect".
> 

Please join the C committee as a voting member or at least submit papers
with language changes. Complaining here won't change anything.

(Out of people in the discussion, I am involved in wg14 discussions and
submit papers.)

>> RUST is better defined that C and is indeed used in OS development
>> these days
> 
> ...so?  I don't see how this is related to the rest of the discussion.
> 

As C is considered as not suitable for OS development, there is an
escape plan, already with a successful story in this domain.

> /~\ The ASCII				  Mouse
> \ / Ribbon Campaign
>  X  Against HTML		mouse%rodents-montreal.org@localhost
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
> 


Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index