the following output is snipped from parrot's build output with msvc-7.1:
...
classes\env.c
env.c
classes\env.pmc(26) : warning C4273: '__p__environ' : inconsistent dll linkage
D:\usr\local\perl\bin\perl.exe build_tools\pmc2c.pl --c classes\env.pmc
...
normally, i'm able to squash all compiler warnings, but i'm having
trouble tracking this one down. this, by the way, is the *final*
compiler warning with msvc, so the person who fixes this bug gets the
'clean windows' award :)
~jerry
>
> the following output is snipped from parrot's build output with msvc-7.1:
> classes\env.pmc(26) : warning C4273: '__p__environ' : inconsistent dll linkage
> D:\usr\local\perl\bin\perl.exe build_tools\pmc2c.pl --c classes\env.pmc
> normally, i'm able to squash all compiler warnings, but i'm having
> trouble tracking this one down. this, by the way, is the *final*
> compiler warning with msvc, so the person who fixes this bug gets the
> 'clean windows' award :)
The story goes like this:
classes/env.pmc
extern char **environ;
Vc7/include/stdlib.h
#define environ _environ
#define _environ (*__p__environ())
_CRTIMP char *** __cdecl __p__environ(void);
#define _CRTIMP __declspec(dllimport)
So, F<classes/env.pmc> declares C<environ> without specific linkage,
whereas F<stdlib.h> says it should be imported from a DLL (namely
msvcrt71.dll). Hence the "inconsistent dll linkage" warning.
There are two possible solutions:
1) Don't declare C<environ> in F<classes/env.pmc>
2) "Correctly" declare C<environ> as
_CRTIMP extern char **environ;
Hope this helps,
Ron
> normally, i'm able to squash all compiler warnings, but i'm having
> trouble tracking this one down. this, by the way, is the *final*
> compiler warning with msvc, so the person who fixes this bug gets the
> 'clean windows' award :)
Attached patch avoids declaration of environ for MS C compilers, as it
is declared in F<stdlib.h>. This should enable compilation on MSVC
8.0, and avoid the warning on previous versions.
Changed Files:
src/classes/env.pmc
Ron
committed as r10508.
~jerry
Great! Thanks Jerry.
Now that the simple stuff is out of the way I can start with more
meaty stuff. env and eval issues are next.
Ron