-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Malc Arnold <[EMAIL PROTECTED]> writes:
> On 09 Jul, Roger Leigh wrote: >> >> * It's written in K&R C. This has been obsolete for 16 years, and >> must be converted. GCC will not support K&R forever; -traditional >> has already been removed. >> * It wrongly prototypes all the functions and exported variables from >> the standard library, including errno. This is *totally broken*, >> and will result in a non-functional program on a modern glibc, and >> will also fail on amd64. > > Why do you think that? Since it doesn't result in a non-functional > program, it would seem you're plain wrong here. Not at all. "extern int errno" is broken on NPTL libc, because it's actually thread-local (i.e. it's effectively "int __thread errno"), rather than global. The correct solution is to include <errno.h>. What I don't get is that you *do* include the standard headers, but then you go and prototype their content *again*, by hand. This is obviously prone to breakage when the header changes, as is the case for errno. > I have to admit that I haven't tested it on amd64, but since it > compiles and runs fine on several 64-bit architectures I see no need > to worry. Because the default return type of a non-prototyped function is "int", this will truncate returned pointers to 32 bits. On a platform using 64-bit pointers, this is a disaster. You may have avoided this one. > What you are talking about here is fine for Debian and Linux, but not > so good for other architectures. This is *not* a Linux program. It's > a Unix program that runs fine under Linux. It also runs just fine on > pretty much anything else since v7 Unix. Which has been dead for 25 years. Please ask yourself how many folks *today* use a K&R compiler. Of those, how many could switch to GCC? Portability is a good goal, but there are limits. You are now getting to be point where you do need to do some work to make it work on current systems. The hacks you were using are no longer appropriate, or portable. There are tools like ansi2knr to help with porting to older systems, and I suggest you take a look at them. If you need to support older compilers, ansi2knr will convert the source on the fly. It's distributed as part of automake, for example. > Well, since I am upstream I'll answer that one. If you think that > mindlessly changing a program in a manner that may break portability > to anything except the one true system is acceptable then you need > to be introduced to the cluebat. The core of af was written on a > system that didn't have an ANSI compiler available. Right. But things have moved on since then. I'm not suggesting "mindless" changes, just porting to ISO C90, i.e. ANSI C. This, as I explained above, need not exclude K&R compilers. Right now, af fails to build with the sid toolchain. The bug is a year old, without any prior response by yourself, and so I would greatly appreciate you taking some action to fix it. Regards, Roger - -- Roger Leigh Printing on GNU/Linux? http://gimp-print.sourceforge.net/ Debian GNU/Linux http://www.debian.org/ GPG Public Key: 0x25BFB848. Please sign and encrypt your mail. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/> iD8DBQFC0O6DVcFcaSW/uEgRAvRYAKCCi3t5EWIu8rXR+SLATkx/7zWjcgCgnCFN bz0n/mGf+Dl1ITbapJ1oGXA= =aI8y -----END PGP SIGNATURE----- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]