Void, VOID, C and C?

Yes, as far as I know the second declaration is invalid in C++ and C89, but it is valid in C99.

Yes, as far as I know the second declaration is invalid in C++ and C89, but it is valid in C99. From The C99 draft, TC2 (6.7.5. 3/10): The special case of an unnamed parameter of type void as the only item in the list speciיִes that the function has no parameters.

It's explicitly talking about the type "void", not the keyword. From The C++ Standard, 8.3.5/2: If the parameter-declaration-clause is empty, the function takes no arguments. The parameter list (void) is equivalent to the empty parameter list.

That it means the actual keyword with "void", and not the general type "void" can also be seen from one of the cases where template argument deduction fails (14.8.2/2): Attempting to create a function type in which a parameter has a type of void.It's put clear by others, notable in one core language issue report here and some GCC bugreports linked to by other answers. To recap, your GCC is right but earlier GCC versions were wrong. Thus that code might have been successfully compiled with it earlier.

You should fix your code, so that it uses "void" for both functions, then it will compile also with other compilers (comeau also rejects the second declaration with that "VOID").

I just put your code in a . Cpp file, and it compiled with no problems in VS2005, SUSE, Redhat, and Solaris, so I guess your specific gcc version does not approve of this. Gal.

Both . C and . Cpp compiles just fine under OS X and fedora core 10 for me (gcc/g++ 4.3.2 in both case)!

Works fine with gcc 4.0.1 on a Mac, even with the flags "-Wall -ansi -pedantic". I don't remember seeing anywhere about the deprecation of void in an empty parameter list though...

Also, the bugs that codelogic mentioned may already be fixed as the current stable version is 4.3.3, and I use Arch Linux, and their repositories have been updated to 4.3.3 already. Edit: My bad, I see that you have Fedora 10, in that case, run this command as root: yum check-update And see if GCC was updated to 4.3.3 in the repository. If so then run: yum update.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions