I am using gcc
to compile my file.c
to object.o
and nm
to list symbols of MinGW.
I would like to know : Why do I get puts
with nm is_alphabet.o -u
when I am using printf with a newline ending with printf("%s\n", c);
? because if I do printf("%s", c);
, I will get printf
.
is_alphabet.c:
#include <stdio.h>
int is_alphabet(char *c)
{
printf("%s\n", c);
// […]
return (1);
}
See my console output:
E:\GitHub\exemple_rendu (main -> origin)
λ sed '17!d' ex00\is_alphabet.c
printf("%s\n", c);
E:\GitHub\exemple_rendu (main -> origin)
λ gcc -Wall -Werror -Wextra -c ex00/*.c
E:\GitHub\exemple_rendu (main -> origin)
λ nm is_alphabet.o
0000000000000000 b .bss
0000000000000000 d .data
0000000000000000 p .pdata
0000000000000000 r .rdata$zzz
0000000000000000 t .text
0000000000000000 r .xdata
0000000000000000 T is_alphabet
U puts
[…]
E:\GitHub\exemple_rendu (main -> origin)
λ sed '17!d' ex00\is_alphabet.c
printf("%s", c);
E:\GitHub\exemple_rendu (main -> origin)
λ gcc -Wall -Werror -Wextra -c ex00/*.c
E:\GitHub\exemple_rendu (main -> origin)
λ nm is_alphabet.o
0000000000000000 b .bss
0000000000000000 d .data
0000000000000000 p .pdata
0000000000000000 r .rdata
0000000000000000 r .rdata$zzz
0000000000000000 t .text
0000000000000000 r .xdata
0000000000000000 T is_alphabet
U printf
I thought is something like macro replacement before compiling and the macro should be probably in stdio.h
but I don't know how to verify my hypothesis and I would like to know how this macro work.