News for hackers. Stuff that matters.
Re:Declaring C String Constants by 0xffff2 on Wednesday May 17, 2017 @02:24PM (#14361286)
>(I didn't know that no-arg functions in C are implicitly variadic! That's bizarre. I would have expected modern compilers to disable that by default, but I can't get Clang to warn me about it even with -Wall.)

I didn't know that either. I wonder if `void bogus(void)` behaves any differently?

Re:Declaring C String Constants by Koshkin on Wednesday May 17, 2017 @02:33PM (#14361403)
Yes, in C you must use 'void' to indicate that the function takes no arguments. (This is deprecated in C++ in favor to an empty argument list - which breaks backward compatibility with C).
Re:Declaring C String Constants by nercht12 on Wednesday May 17, 2017 @05:23PM (#14362920)
What happens if I extern a C function with no "void" then? Do I get a variadic in C++?
Re:Declaring C String Constants by Koshkin on Thursday May 18, 2017 @10:59AM (#14367773)
C++ is not backwards compatible with C in this regard.
Re:Declaring C String Constants by aidenn0 on Thursday May 18, 2017 @01:45AM (#14365049)
It's not variadic, it's unspecified arguments. The compiler ought to complain if two function calls are made with conflicting argument types.
Re:Declaring C String Constants by kccqzy on Wednesday May 17, 2017 @02:31PM (#14361368)
Yes it would behave differently. Putting void in the parenthesis tells the compiler the function accepts no arguments at all.
Re:Declaring C String Constants by 0xffff2 on Wednesday May 17, 2017 @02:43PM (#14361529)
Good to know. I never bothered with `void` inside the argument list in C before (I primarily write C++, very rarely C). I will have to remember to be more explicit when I do write C code in the future.