|
From: | Dennis Clarke |
Subject: | Re: GNU make 4.2.93 release candidate available |
Date: | Fri, 10 Jan 2020 11:02:55 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Thunderbird/72.0 |
On 2020-01-07 20:39, Paul Smith wrote:
On Mon, 2020-01-06 at 05:33 -0500, Dennis Clarke wrote:The only nit, and it is a little nit, is the strange use of a three parameter main() in src/main.c line 1054 and this is a "warning". Well strictly speaking, pun intended, that isn't a terrible sin but it isn't correct either. Sure, tossing in char **envp as the third rail on the main() can work and usually does work it isn't supposed to work. I looked in there and there is no good reason to not use getenv() but who knows what voodoo to do in windows32? I surely don't.Just for clarity, getenv() isn't sufficient. That requires that you know what variables you want to look up: in GNU make we need to walk through all the variables so we can import each one as a make variable. In POSIX we can use extern char** environ instead. On Windows you can use _environ although my impression is that might not work everywhere (but it might be good enough for make). On other systems there may be other things. While the third arg to main isn't actually part of any standard, even POSIX, it's actually very widely supported.
Yep. Wrong and it seems to work anyways. I was slightly surprised to get this latest alpha gmake 4.2.93 to compile clean and test perfectly on old Solaris 10. I keep around that sort of hardware for production reasons and they are all legacy now. One thing is true however and that is the OS is tightly standards compliant and that includes the Oracle/Sun Studio 12.6 C99 compiler with obsessive compulsive compliance flags. I nearly spit out my coffee. Clean. Every damn line with the exception of a tiny little warning about "hey there please don't use a third parameter to main(), thanks".See ISO/IEC 9899:TC3 WG14/N1256 bloody C99 specifications section 5.1.2.2.1 Program Startup :
The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int and with no parameters: int main(void) { /* ... */ } or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared): int main(int argc, char *argv[]) { /* ... */ } or equivalent; 9) or in some other implementation-defined manner. Right. However gmake tries int argc, char **argv, char **envp in src/main.c at line 1054 and I am trying to care. I don't really. For some reason you say GNU make needs to read in the entire users environment? Really? OKay ... *shrug* ... Meanwhile a friend and I are giving 4.2.93 a look on FreeBSD 12.0 and a whole slew of packages fail to build. We don't know why yet : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243145 Feels like progress to me regardless. I will stay in touch as I drag this over multiple systems and architectures. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional
[Prev in Thread] | Current Thread | [Next in Thread] |