Date: Fri, 26 Jan 2024 16:54:13 +0100 From: Adam <a...@netbsd.org> Message-ID: <a16ac5df-ccc4-4731-921b-dac063945...@netbsd.org>
| The above is a hack. IMHO my fix is a cleaner one. The question is really why we're building libc functions (for the tools libcompat) without _LIBC_INTERNAL defined. I think it should be. | Anyway, the problem seems to be related to Clang, Not really, the issue is more what flags are passed to the compiler, what is a warning, and what is treated as an error. It looks as if the tool build is just treating this as a warning (using gcc - or whataver the native host compiler is) and your clang is not. That's all understandable, we have little control of host compilers, they can do whatever they normally do, and we just need to live with it (the tools build cannot really start giving compiler specific options to turn on, or off, warnings or errors). | It doesn't accept implicit function declarations. Yes, that's fine - you do not need to explain the issue, we all understand that --- but there's supposed to be a prototype for the function, it isn't intended to be implicit. That's what we really need to fix. My "hack" was doing that in a relevant include file, but you're right, that is a hack, and wouldn't fix any similar issues that might arise in some other function some other time (protototypes for public functions (which this one shouldn't be, apparently, but is) are gradually moving out of .c files and into .h files instead). The right way is to put an appropriate -D in the right place in a CPPFLAGS definition in some Makefile or other - I tried to do it that way, but obviously not correctly, as the build didn't add the -D to the compile line - when I start looking at modern Makefiles my eyes just glaze over at the absurdity of the whole system as it is now (makefiles used to be a nice simple declarative specification of what depended on what, and how to build things, they have turned into a truly baroque and horrid programming language instead ... but that rant is off topic here.) So, what it needs is for someone to work out how to pass -D_LIBC_INTERNAL to the tools libcompat build, and fix things properly. kre