Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: extra ';' problem 1

Status
Not open for further replies.

Hemo

Programmer
Apr 9, 2003
190
US
Ok, first off I am no C++ programmer, though I know a little about C and have written some simple things in C.

The author of this code passed away in late 2003 or I would be consulting with him.

I have a C++ package that has compiled on previous linux releases (redhat 8, suse 8,9,etc) but now I am on opensuse 10.2 and running into an error during make:

../kperl.h:49: error: extra ‘;’
../kcolorstring.h:183: error: extra ‘;’

Here is a snippet from kperl.h, these are lines 47-49:
Code:
namespace KPerl {
enum EventType {Invalid, Input, Connect, Disconnect, TelnetOp, TelnetSubOp, Exit, LoggedIn};
};

I could post the snippet from kcolorstring if asked.

OpenSuse uses gcc version 4.1.2


 
Remove the semicolon after the last }
Strange that it would give you an error though. I'd just consider that a warning.
 
I personally think that extra semicolons should never be errors (unless in for loop), they should evaluate to nop instructions in the assembly. I can see it being a warning, in case it was an accident; but I think (though I'm not sure) your compiler isn't compling to the C99 standards.

The solution should be as cpjust said.

[plug=shameless]
[/plug]
 
I had done the removal of the ';' at the end of the last '}' and that seems to work. Did the same for the kcolorstring.h file I also mentioned and both compiled through without a hitch.

I failed to mention I was also setting CFLAGS="-march=k8 -O2 -pipe -std=c99", but it seems it still wasn't adhering to the C99 standards.

Anyways, thanks for the info. Appreciate the help. I now have some braced-groups within expressions to hunt down.. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top