473,804 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C2485 __declspec(rest rict)

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(rest rict)

But that attribute _is_ valid....

Any ideas?

TIA

Fernando Cacciola



Mar 22 '06 #1
2 8433
> 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(rest rict)

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(rest rict) char * rfun();
it copiles just fine, but if I try this:
__declspec(__re strict__) 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************* *********@hotma il.com
Remove only "_nos_pam"
Mar 22 '06 #2
WinUser
1 New Member
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(__re strict)
but had to be: __declspec(rest rict)

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
1823
by: Kuljit | last post by:
Hello everyone, What are data type qualifers? - Kuljit Singh Tomar ..
4
4410
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 pthread_mutex_init (pthread_mutex_t *__restrict __mutex, __const pthread_mutexattr_t *__restrict __mutex_attr) __THROW;
13
2285
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 virtual functions, and functions you can call to instantiate and delete objects of the type. You can then just call virtual functions on the type."
0
9712
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.