Commercial Computing with C/C++

Previous Next
1

A quick one on SEARCH/NOSEARCH

Posted by Visda Jul 25, 2009

Search.jpg I think this option's name, (especially the negative one), is pretty confusing. Be that as it may, NOSEARCH wipes out all the previous search specifications and SEARCH sets them.

In METAL C a subset of standard C libraries have been defined, in this context this option becomes pretty handy.

In short, if strcpy is used in the user code, to avoid unexpected compile time messages complaining about strcpy syntax, incorrect run time behavior or what not, its declaration and definition should be pulled in from the METAL string.h header file.


cat foo.c


#include <string.h>
int main() {
char s[10];
memset(s,0,sizeof(s));
strcpy(s,"hello");
return 55;
}



xlc -S -c -qmetal foo.c -qlist=./
grep 'string.h' foo.lst



1 /usr/include/string.h wrong!!!

xlc -S -c -qmetal -qnosearch -I/usr/include/metal foo.c -qlist=./
grep 'string.h' hello.lst



1 /usr/include/metal/string.h correct!!!


The End!



Oct 14, 2009 5:28 PM Click to view VolodymyrPaprotski's profile VolodymyrPaprotski

As promissed, I have created a post here on zOS Include files and their options.

Bottom Banner