Replying to myself:

On 2021.03.20 13:12, Pete Batard wrote:
* _Static_assert is relatively new to C, so you should probably also
add an #elif for __STDC_VERSION__ < 201112L.

'static_assert()' was formalized as a formal built in macro in C11, but the _Static_assert() built in macro we use was introduced sooner, as compiler extensions.

Per [1], we run a configure test to find out if the compiler has support for _Static_assert, so we don't need an extra version check.

Oh, I see what you mean now.

This is about when using gcc/Clang when building the UEFI driver, where of course the configure test does not apply.

So that is a valid point, though we need to consider that both EDK2 and gnu-efi have some limitations when it comes to older compiler support, and, unlike what it the case for core ntfs-3g (where someone might actually be able to compile a version for, say, Amiga systems using old toolchains), the expectation that someone will be trying to compile for UEFI with a compiler that doesn't support static assert is pretty low.

I need to think about this, because still want older non C11 compilers, that do have _Static_assert(), to be able to use it for non UEFI ntfs-3g, and using your suggestion would filter these out. All in all, I think I'm probably going to add an explicit blanket filter in uefi_compat.h for any compiler that isn't MSVC to be C11 compliant.

Regards,

/Pete


_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to