473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C2485 __declspec(restrict)

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



Mar 22 '06 #1
2 8374
> 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
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 22 '06 #2
C2485 __restrict__ is an invalid attribute.

had nearly the same problem:

error C2485: '__restrict' : unrecognized extended attribute

the reason for this error was, in another header restrict was defined to __restrict:

#define restrict __restrict

so because of that the keyword was: __declspec(__restrict)
but had to be: __declspec(restrict)

undefiing restrict solved the problem.

Gruss
May 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kuljit | last post by:
Hello everyone, What are data type qualifers? - Kuljit Singh Tomar ..
4
by: Raman | last post by:
Hi All, The declaration of pthread_mutex_init in pthread.h is as in pthread.h Some one please explain. ( what is "__resrict", whay "__" before "mutex" and what is __THROW. extern int...
13
by: Anonymous | last post by:
On MS site: http://msdn2.microsoft.com/en-us/library/esew7y1w(VS.80).aspx is the following garbled rambling: "You can avoid exporting classes by defining a DLL that defines a class with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.