From owner-freebsd-hackers Fri Aug 7 07:24:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA12539 for freebsd-hackers-outgoing; Fri, 7 Aug 1998 07:24:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from elvis.vnet.net (elvis.vnet.net [166.82.1.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA12438 for ; Fri, 7 Aug 1998 07:24:01 -0700 (PDT) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by elvis.vnet.net (8.8.8/8.8.4) with ESMTP id KAA15677; Fri, 7 Aug 1998 10:23:22 -0400 (EDT) Received: from lakes.dignus.com (lakes [10.0.0.3]) by dignus.com (8.8.8/8.8.5) with ESMTP id KAA07476; Fri, 7 Aug 1998 10:57:04 -0400 (EDT) Received: (from rivers@localhost) by lakes.dignus.com (8.8.8/8.6.9) id KAA23918; Fri, 7 Aug 1998 10:27:29 -0400 (EDT) Date: Fri, 7 Aug 1998 10:27:29 -0400 (EDT) From: Thomas David Rivers Message-Id: <199808071427.KAA23918@lakes.dignus.com> To: jb@cimlogic.com.au, tlambert@primenet.com Subject: Re: C and static initialization with unions Cc: chuckr@Glue.umd.edu, freebsd-hackers@FreeBSD.ORG, mike@smith.net.au, Nicolas.Souchu@prism.uvsq.fr In-Reply-To: <199808070739.AAA23183@usr08.primenet.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Terry Lambert writes: > > It's perfectly possible to get these warnings from a K&R compiler. > To do this, you need to change your object format to attribute the > symbol table entries. Fred Fish did this for the Motorolla 88k > compiler back in the early 80's. What we are suffering here is a > legacy of compiler writers too lazy to implement decent smart linker > technology. As one of the "compiler writers too lazy" :-) Let me quickly add that compiler writers usually distinguish themselves from linker writers. I'd point the finger at the linker writers :-) :-) Anyway; to credibly add to Terry's point. HP's MPE system (on an HP-3000) did this type of link-time checks as well... which was "way cool" for FORTRAN programs. [A side-effect of the fact this was a stack machine also made for some nice FORTRAN programs...] Furthermore, I had the job of porting Fred's 78K emulator (before Motorola changed the name to 88k) to Data General's AOS system. After getting everything running (comiler, linker, emulator) one of the first things everyone disliked was the link-time checking. I don't believe that survived in the actually 88K stuff... So, it's not just that people don't do it; sometimes, users don't want it... And, to close, Microsoft "kinda" does this with __cdecl functions. They append "@nnn" to the symbol, where nnn is the amount of incoming parm size the function requires. You could use this for some simple C-level function overloading... if you really wanted to... So, I suppose; my point is there is ample precident to consider doing something like that in a linker... if we wanted to. Now, to go find some of those "linker writers".... - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message