From: SourceForge.net <no...@so...> - 2004-01-19 22:14:19
|
Feature Requests item #880157, was opened at 2004-01-19 14:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=880157&group_id=599 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Helpful warning when "data" used for variable name Initial Comment: Despite being a well documented keyword, "data" is commonly used as a variable name. This feature request is to add a special check for "data" (and possibly other memory types) after printing the parse error, and print an additional message if "data" was seen in the current or previous tokens, or "data" occurs on the line shortly before the location of the parse error. Here is a tiny example: void test(int c) { int data=0; data += c; } test.c:3: parse error: token -> '=' ; column 17 test.c:4: error: code not generated for 'test' due to previous errors test.c:4: warning: in function test unreferenced function argument : 'c' Adding a special check for "data" (and perhaps the other non-ansi memory qualifiers) would really save a lot of confusion and frustration for new users. For example: test.c:3: parse error: token -> '=' ; column 17 test.c:3: warning: possible use of reserved keyword "data" as variable or function name? test.c:4: error: code not generated for 'test' due to previous errors test.c:4: warning: in function test unreferenced function argument : 'c' I should mention that there is already a "useless declaration" warning that covers the case of "data" declared as an unitialized variable. But it does not catch the common case of an initialized variable as shown in this example. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=880157&group_id=599 |