From: SourceForge.net <no...@so...> - 2004-02-09 00:21:24
|
Feature Requests item #893037, was opened at 2004-02-08 15:05 Message generated for change (Comment added) made by epetrich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=893037&group_id=599 >Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: switch-case with default wich has no break; at the end Initial Comment: Hi! Im useing SDCC Feb 3 2004 (MINGW) with the parameters: sdcc.exe main.c -mmcs51 --use-stdout --no-xinit-opt - I. -c It will fail to compile the code: void f(int a) { switch (a) { default: } } The message: main.c:7: parse error: token -> '}' ; column 9 But if you place a "break;" under the default it will work fine. Anyway its ok just .... Best regards and many thanks for this compiler guys! beba beba(no spam)koli.kando.hu ---------------------------------------------------------------------- >Comment By: Erik Petrich (epetrich) Date: 2004-02-08 18:21 Message: Logged In: YES user_id=635249 This is not a bug. According to the syntax given in the ANSI C standard, all labels, including "default:" are to be followed a statement. However, it is not usual for compilers to support what you are wanting as an extension to the language, so I have reclassified this from a bug report to a feature request. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=893037&group_id=599 |