From owner-freebsd-current Sun Aug 23 04:48:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA03448 for freebsd-current-outgoing; Sun, 23 Aug 1998 04:48:19 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA03418 for ; Sun, 23 Aug 1998 04:48:08 -0700 (PDT) (envelope-from seggers@semyam.dinoco.de) Received: (from uucp@localhost) by tim.xenologics.com (8.8.5/8.8.8) with UUCP id NAA15880; Sun, 23 Aug 1998 13:42:29 +0200 (MET DST) Received: from semyam.dinoco.de (semyam.dinoco.de [127.0.0.1]) by semyam.dinoco.de (8.8.8/8.8.8) with ESMTP id NAA06941; Sun, 23 Aug 1998 13:38:29 +0200 (CEST) (envelope-from seggers@semyam.dinoco.de) Message-Id: <199808231138.NAA06941@semyam.dinoco.de> To: Kris Kennaway cc: Mike Smith , freebsd-current@FreeBSD.ORG, seggers@semyam.dinoco.de Subject: lpr code cleanup? (was: Re: gcc 2.8 ) In-reply-to: Your message of "Sun, 23 Aug 1998 12:47:34 +0930." Date: Sun, 23 Aug 1998 13:38:28 +0200 From: Stefan Eggers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Unfortunately I'm not a very experienced C/C++ coder; I doubt I would have > the skills to identify how to fix these problems, but I'll see if I can > would be able to do better, though. lpr (one of the bits which fails due > to warnings being treated as errors) is probably an easy target for > someone who has a good understanding of C semantics and standards; there's [Just did an experiment by checking out the lpr module, adding an empty Makefile.inc on which it insisted in the parent directory and then doing "CC=egcc make" there. Egcc was from sometime in July.] It's easy to explain. Some parts of the code like lpr itself use the macro CWARNFLAGS which include -Werror changing all warnings to errors. Now egcs sees "register i" in lpr.c which isn't nice, issues a warning and then it makes a loud *boom*. The compilation failed. :-( While I looked at the code there I noticed other parts of the printing system like lpq don't use CWARNFLAGS and just add -Wall. Shall I try to correct this and get it compile w/o any warnings? In the case above a "register int i" won't hurt. It's even OK for K&R compilers so I think such a change would be a good thing. If so how shall I set the warning flags? Use the more complete CWARNFLAGS in all parts of the printing system or leave it as it is now? Stefan. -- Stefan Eggers Lu4 yao2 zhi1 ma3 li4, Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1. 51109 Koeln Federal Republic of Germany To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message