- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use memset_s.
I have version icpc version 16.0.3.210
The compiler says the symbol is undefined.
I have tried including strings.h and also defining __STDC_WANT_LIB_EXT1__
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us!
We are able to reproduce the same error on our end. We are forwarding this thread to the concerned internal team.
Thanks & Regards
Goutham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
memcpy_s is only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation and if the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before including string.h. (https://en.cppreference.com/w/c/string/byte/memcpy)
$ icpc mem_s.cpp -c
$ cat mem_s.cpp
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
char temp_str[10];
#ifdef __STDC_LIB_EXT1__
memset_s(temp_str, 'H', sizeof(temp_str));
#endif
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried previously what you have. I am still having issues.
Do I need a certain version of gcc for this to work?
If so how do I point icpc to a different version of gcc?
I am using:
Intel icpc version 16.0.3.210
The version of gcc on the machine I compile with is 4.4.7
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't have a system with gcc4.4. but it worked on gcc4.8
$ icpc mem_s.cpp -c -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.3.210 Build 20160415
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
vahoang@orcsle147:/tmp$ gcc -v
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
You can set -gcc-name=/gxx-name= to point to a location of gcc/g++
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue has been resolved and we will no longer respond to this thread.
If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page