C2485 __declspec(restrict)

  • Thread starter Thread starter Fernando Cacciola
  • Start date Start date
F

Fernando Cacciola

Hi,

I'm having a very strange problem with VC8

When compiling a library called gmp (v 4.1.4); with win32 patches applied
for VC7 (VC8 is not directly supported yet), I get this error all over
pretty much every system header:

C2485 __restrict__ is an invalid attribute.

The offending code, in places like malloc.h, stdlib.h, etc,
contains the macro _CRTRESTRICT, which is defined in crtdefs.h as
__declspec(restrict)

But that attribute _is_ valid....

Any ideas?

TIA

Fernando Cacciola
 
Hi,
I'm having a very strange problem with VC8

When compiling a library called gmp (v 4.1.4); with win32 patches applied
for VC7 (VC8 is not directly supported yet), I get this error all over
pretty much every system header:

C2485 __restrict__ is an invalid attribute.

The offending code, in places like malloc.h, stdlib.h, etc,
contains the macro _CRTRESTRICT, which is defined in crtdefs.h as
__declspec(restrict)

But that attribute _is_ valid....

Any ideas?

TIA

Fernando Cacciola

Hi,

I noticed that in your error message, restrict is surrounded by 2
underscores on each side.
if I compile this:

__declspec(restrict) char * rfun();
it copiles just fine, but if I try this:
__declspec(__restrict__) char * rfun();

I too get
error C2485: '__restrict__' : unrecognized extended attribute

Which leads me to believe that somehow your declspecs get mangled since
__restrict__ really is invalid.

You said that VC8 was not yet explicitly supported by that toolkit.
restrict was not yet known by VC7.1.
Could it be that a macro definition is wreaking havoc?

If that is the case then you can find this out by looking at the
preprocessed output and checking
what gets changed because ot which definitions.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
Back
Top