artyom-beilis / float16

half float library for C and for z80
MIT License
34 stars 7 forks source link

Functions should be annotated with the const attribute #3

Closed nemequ closed 4 years ago

nemequ commented 4 years ago

See https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute for documentation.

It's not really just GCC, several compilers support it… it would be great you supported at least clang, too, but if you want to just use the macro from Hedley that would be best IMHO. That said, I'm the sick bastard who wrote Hedley so obviously I'm biased.

artyom-beilis commented 4 years ago

Never heard of it and it is in general very GCC specific so... I don't think I'll add it as in general this library implementation in C is more reference implementation that high performance one.

nemequ commented 4 years ago

It's really not GCC-specific… clang, Intel C/C++, Oracle Developer Studio, IBM XL C/C++, ARM C/C++, and various TI compilers also support it.

But I would probably #include the C anyways instead of treating it as a separate compilation unit anyways, so this doesn't really effect me.