Hello.

2018-01-15 20:56 GMT+01:00 Jiří Zárevúcky <[email protected]>:
>> - It's not standard.
>>
>> True, but meaningless. We use plenty of nonstandard extensions. It's
>> literally impossible to implement libc without using some.
>>
>> - Some archaic/toy compiler may not support it.
>>
>> Also true, but as JJ said, such a compiler wouldn't build HelenOS
>> anyway. #pragma once is supported by any half-serious C compiler (see
>> https://en.wikipedia.org/wiki/Pragma_once).

I think we should distinguish whether we are talking about the public
headers or the implementation itself. While it is true that a toy
compiler will not compile the whole HelenOS, such toy compiler can
still be used to compile against HelenOS headers. Not a common case
but due to simplicity of our library not a completely impossible one
either.

And I would say that especially for system (libc) headers we should be
as conservative as possible.

By the way, some libraries actually expect that headers are guarded
[1] and we had patches for that in Coastline [2] as we are using
uncommon naming (and yes, I think that it is wrong but that is not the
point).

[1] https://gmplib.org/repo/gmp-5.1/file/c0a9c060cb8a/gmp-h.in#l247
[2] https://github.com/HelenOS/harbours/blob/f089b58cd/libgmp/HARBOUR#L44

Just my $.02.

Cheers,
- Vojtech


>>
>> - `#pragma once` is in trouble if the same header is accessed via
>> multiple paths.
>>
>> Not an issue for us. Multipath headers are a bug, not a feature.
>>
>> -- jzr
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to