1

I'm evaluating IC 2018, while normally working with IC 2016 & MSVC & CLANG. IC 2018 seems not to cope with several things.

First it doesn't like _Pragma, for instance:

_Pragma("forceinline recursive")

I need that to support multiple compilers like this:

#define MFORCEINLINE    _Pragma("forceinline recursive")

Then it also fails with the keyword restrict (previously used by IC), but it seems that __restrict may work. After the gazillion keywords I gave up. Am I doing something wrong? Mainly with the pragmas, I use a lot of those for various optimization specifications.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Vojtěch Melda Meluzín
  • 1,117
  • 3
  • 11
  • 22
  • IDK what "recursive" does, but ICC implements GNU C/C++ extensions, [including function attributes](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes), so try `__attribute__((always_inline)) int foo(int bar) { ...; }` to force a function to inline even when compiling without optimization. – Peter Cordes Mar 12 '18 at 02:10
  • And yes, in C++ you should be using `__restrict`. I think it's supported across gcc/clang/icc/msvc. I'm surprised any compilers allowed the C99 `restrict` keyword in C++ mode. Or were you compiling as C before? – Peter Cordes Mar 12 '18 at 02:11
  • Thanks for the info! It's just that it was different before, so I thought "maybe I missed some option or something". Anyways thanks for the __attribute__((always_inline)) idea, didn't know it could work on Windows as well. – Vojtěch Melda Meluzín Mar 12 '18 at 10:43

0 Answers0