-nostdlib option!
Ian Lance Taylor
iant@google.com
Tue Feb 15 15:52:00 GMT 2011
ali hagigat <hagigatali@gmail.com> writes:
> I am compiling my C programs with -nostdlib option without providing
> mem functions like memcpy and GNU tool chain has not complained so
> far(gcc 4.4.2, Fedora 12). Is that natural? I have defined char
> pointers, nested functions and no error so far. I wonder if anybody
> can write a simple C program and compile it with -nostdlib so that the
> compiler needs one of mem functions and the compiler stops with an
> error.
If I compile this file:
struct s { char a[100000]; };
struct s v;
void f(struct s *p) { v = *p; }
for the x86_64 with no optimization, I get a call to memcpy.
Ian
More information about the Gcc-help
mailing list