From owner-freebsd-bugs Fri May 9 09:11:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA12740 for bugs-outgoing; Fri, 9 May 1997 09:11:52 -0700 (PDT) Received: from george.lbl.gov (george-2.lbl.gov [131.243.2.12]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id JAA12732; Fri, 9 May 1997 09:11:45 -0700 (PDT) Received: (jin@localhost) by george.lbl.gov (8.6.10/8.6.5) id JAA28108; Fri, 9 May 1997 09:11:41 -0700 Date: Fri, 9 May 1997 09:11:41 -0700 From: "Jin Guojun[ITG]" Message-Id: <199705091611.JAA28108@george.lbl.gov> To: freebsd-bugs@FreeBSD.ORG, joerg@FreeBSD.ORG Subject: Re: gnu/3554 Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Synopsis: cc failed on deafult <= default > > That's actually legal C code. Theoretically, it is correct; but it is awkward. This kind program bug is very hard to find out without checking every word of the code. cc does NOT provide any information/warrning on it, then how do you know the default has been a typo? In the huge code program, where do you look for the bug? The cc could be a little smart to do this: if "default:" is found in a switch block, then no further check. otherwise, if no "default:" is in a switch block, but some similar label is found, which may be a type, gives a warning: warning: default is not defined in this switch block, but a similar lable was found. This may be a typo. Does this look better? -Jin