- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Intel 16.0.2 on Windows I get seqbla16.c(3909): warning #167: argument of type "const char *" is incompatible with parameter of type "const char *" _mm_prefetch((char const *) (outvec+i),_MM_HINT_NTA);
How come
const char *
is not compatible with
const char *
?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @erling_Andersen,
That's interesting but I couldn't reproduce that warning with small test cases I tried with that prefetch call. Can you please attach a test reproducer? Appreciate much, for your help.
Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not that important. I just thought it was strange.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @erling_Andersen,
Thanks but still it's an interesting issue to fix. Unfortunately, I cannot file an issue with developers unless I have a reproducer. If I bump into this warning I'll surely let them know. Again, appreciate for letting us know.
Thanks,
Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will get back if manage to create a small example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to use reinterpret_cast<const char*>(outvec + i) and see if the warning still persists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is how to reproduce the issue
-out:testprefetch.exe
testprefetch.obj
c:\Users\eda\mosekdbg>ICL /Wcheck testprefetch.c
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.2.180 Build 20160204
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
testprefetch.c
testprefetch.c(11): warning #167: argument of type "const char *" is incompatible with parameter of type "const char *"
_mm_prefetch((const char *) x,_MM_HINT_NTA);
^
Microsoft (R) Incremental Linker Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
-out:testprefetch.exe
testprefetch.obj
where
#include <stdio.h>
#include <xmmintrin.h>
int main()
{
double x[2];
_mm_prefetch((const char *) x,_MM_HINT_NTA);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to the MSDN documentation here:
https://msdn.microsoft.com/en-us/library/84szxsww%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396
the first argument to _mm_prefetch takes a char* argument not a const char*.
So I think the warning should really say argument of type "const char*" is incompatible with parameter of type "char*".
I think the compiler is confused because it's an intrinsic (i.e. there is no prototype in the header file).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@erling_Andersen, - thanks I could reproduce the issue.
Hi Judy, I'll go ahead and file a CQ on this.
Thanks,
Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Issue# filed is: DPD200410062
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your reference is to Visual Studio 2008. In Visual Studio 11 it has the more correct declaration
extern void _mm_prefetch(char const*_A, int _Sel);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree. More recent MS versions have changed the prototype from char* to const char* - thanks.
Kittur

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page