Why am I getting this warning when using extern int errno?
All my C programs are always built on Linux like systems, but this time I'm programming on a Windows system. Every time I use the global variable errno from errno.h I get the following warning: #include <stdio.h> #include <errno.h> extern int errno; int main() { errno = -10; printf("%d\n", errno); return 0; } Warning: '_errno' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] extern int errno; Funny, when I comment that line the warning disappear, but why? I really don't understand why that warning is displayed, because when I compile the same code on a linux system, gcc doesn't display nothing. In both cases, I use flags -g and -Wall to debug program..... I will appreciate if someone explain me this, thank you🤗😀