473,387 Members | 1,844 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,387 software developers and data experts.

problem with latest platform SDK and intrin.h

I am using the current platform SDK headers and libraries (including the
CRT headers and static CRT libraries). If I #include windows.h and intrin.h
in the same source file, the compiler spits out error C2733: second C
linkage of overloaded function '_interlockedbittestandset' not allowed
(doesn't matter if I #include intrin.h or windows.h first).
It doesn't happen if I use the header files and libraries that come with
Visual C++ 2005 pro.
Does anyone know why this is and what I can do about it?
Jun 2 '07 #1
4 10533
"Jonathan Wilson" <jf*****@tpgi.com.auwrote in message
news:Ox**************@TK2MSFTNGP02.phx.gbl...
>I am using the current platform SDK headers and libraries (including the
CRT headers and static CRT libraries). If I #include windows.h and intrin.h
in the same source file, the compiler spits out error C2733: second C
linkage of overloaded function '_interlockedbittestandset' not allowed
(doesn't matter if I #include intrin.h or windows.h first).
It doesn't happen if I use the header files and libraries that come with
Visual C++ 2005 pro.
Does anyone know why this is and what I can do about it?

There are 2 conflicting declarations of _interlockedbittestandset.

In intrin.h the first argument is long *
In WinNT.h the first argument is long volatile *

I'm not sure which declaration is correct but my solution was to edit
intrin.h and add the volatile keyword.

Jun 2 '07 #2
"Tom Walker" <no****@nowhere.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
"Jonathan Wilson" <jf*****@tpgi.com.auwrote in message
news:Ox**************@TK2MSFTNGP02.phx.gbl...
>>I am using the current platform SDK headers and libraries (including the
CRT headers and static CRT libraries). If I #include windows.h and
intrin.h in the same source file, the compiler spits out error C2733:
second C linkage of overloaded function '_interlockedbittestandset' not
allowed (doesn't matter if I #include intrin.h or windows.h first). It
doesn't happen if I use the header files and libraries that come with
Visual C++ 2005 pro.
Does anyone know why this is and what I can do about it?


There are 2 conflicting declarations of _interlockedbittestandset.

In intrin.h the first argument is long *
In WinNT.h the first argument is long volatile *

I'm not sure which declaration is correct but my solution was to edit
intrin.h and add the volatile keyword.
To me the C++ standard says there was no collision. Page 214, last
paragraph:
* Only the const and volatile type-specifiers at the outermost level of the
* parameter type specification are ignored in this fashion; const and
* volatile type-specifiers buried within a parameter type specification are
* significant and can be used to distinguish overloaded function
* declarations.

Jun 4 '07 #3
Norman Diamond wrote:
"Tom Walker" <no****@nowhere.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>"Jonathan Wilson" <jf*****@tpgi.com.auwrote in message
news:Ox**************@TK2MSFTNGP02.phx.gbl...
>>I am using the current platform SDK headers and libraries
(including the CRT headers and static CRT libraries). If I #include
windows.h and intrin.h in the same source file, the compiler spits
out error C2733: second C linkage of overloaded function
'_interlockedbittestandset' not allowed (doesn't matter if I
#include intrin.h or windows.h first). It doesn't happen if I use
the header files and libraries that come with Visual C++ 2005 pro.
Does anyone know why this is and what I can do about it?


There are 2 conflicting declarations of _interlockedbittestandset.

In intrin.h the first argument is long *
In WinNT.h the first argument is long volatile *

I'm not sure which declaration is correct but my solution was to edit
intrin.h and add the volatile keyword.

To me the C++ standard says there was no collision. Page 214, last
paragraph:
* Only the const and volatile type-specifiers at the outermost level
of the * parameter type specification are ignored in this fashion; const
and
* volatile type-specifiers buried within a parameter type
specification are * significant and can be used to distinguish overloaded
function
* declarations.
The outermost level would be the difference between long * and long *
voliatile. In this case, the difference is between long volatile * and long
*, so the cv-qualifier is buried inside the declared type and does make a
difference. The compiler is complaining that since the function has C
linkage, it can't have two different overloads that differ only by CV
qualifiers as those are two separate function definitions s for C++, but a
single function definition for C.

-cd
Jun 4 '07 #4
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:uk**************@TK2MSFTNGP05.phx.gbl...
Norman Diamond wrote:
>"Tom Walker" <no****@nowhere.comwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>>"Jonathan Wilson" <jf*****@tpgi.com.auwrote in message
news:Ox**************@TK2MSFTNGP02.phx.gbl...
I am using the current platform SDK headers and libraries (including
the CRT headers and static CRT libraries). If I #include windows.h and
intrin.h in the same source file, the compiler spits out error C2733:
second C linkage of overloaded function '_interlockedbittestandset' not
allowed (doesn't matter if I #include intrin.h or windows.h first). It
doesn't happen if I use the header files and libraries that come with
Visual C++ 2005 pro. Does anyone know why this is and what I can do
about it?

There are 2 conflicting declarations of _interlockedbittestandset.

In intrin.h the first argument is long *
In WinNT.h the first argument is long volatile *

I'm not sure which declaration is correct but my solution was to edit
intrin.h and add the volatile keyword.

To me the C++ standard says there was no collision. Page 214, last
paragraph:
* Only the const and volatile type-specifiers at the outermost level
* of the parameter type specification are ignored in this fashion; const
* and volatile type-specifiers buried within a parameter type
* specification are significant and can be used to distinguish
* overloaded function declarations.

The outermost level would be the difference between long * and long *
voliatile. In this case, the difference is between long volatile * and
long *, so the cv-qualifier is buried inside the declared type and does
make a difference.
OK, you agreed with me on that part of it, so you wasted time agreeing with
me before explaining why that part of it was irrelevant. Now just for
clarification, I'll agree with you on the part that seems to be relevant:
The compiler is complaining that since the function has C linkage, it
can't have two different overloads that differ only by CV qualifiers as
those are two separate function definitions s for C++, but a single
function definition for C.

-cd
OK yes, with C linkage that looks like a collision. With C linkage nearly
any kind of overload would be a collision.

Now where did I read rumours that Microsoft had started doing some
dogfooding again...

Jun 4 '07 #5

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

Similar topics

1
by: Matej Kenda | last post by:
Hi all, This message is to let you know that I have successfully compiled the latest sources from the 2.3 branch on the abovementioned OS using the HP ansiC compiler version 5.50. Final...
1
by: Robert Hathaway | last post by:
COMP.OBJECT FAQ Version II Beta now Available http://www.objectfaq.com/oofaq2 ================================================== - Latest Important Information on Object Technology - What's New...
12
by: P. Adhia | last post by:
The latest UDB DB2 PDE V8.2.2 (posted 4/22/05) for linux that is available for download as tar file (all editions), have invalid tar format (I guess I should have taken quality issues raised on...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
10
by: Ole | last post by:
Hi, Using VS2005 and a windows CE 5.0 device running CF2. Suddenly I can't debug my C# program from VS2005 - when setting a breakpoint I only see a ring instead of the normal red dot and when...
2
by: Marek Suski | last post by:
Hi all, I am getting following error while a user is trying to execute web method from proxy class (proxy class inhertis from WebServicesClientProtocol class) System.Xml.XmlException: There is...
16
by: Eigenvector | last post by:
I've been surfing the FAQ and Google for about a week and haven't quite figured out this one. I have a file that changes on a periodic basis and every once and a while ^Zs will appear in the...
3
by: djp1988 | last post by:
I have made up a code allowing users to click on a tab and show content in a neat white box, similar to what yahoo have on their homepage. I have used 5 divs, all but one set to display:none and...
1
by: swethak | last post by:
Hi, I write the code to display images.But it will not display image.And also gives the error like that error : Notice: Undefined index: gim in F:\Facebook\pic_up.php on line 59 plz tell...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
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...
0
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,...
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.