[Geany] [PATCH] Fixes for warnings and portability

Nick Treleaven nick.treleaven at xxxxx
Tue Feb 19 14:08:28 UTC 2008


On Tue, 19 Feb 2008 10:44:17 +0100
Enrico Tröger <enrico.troeger at uvena.de> wrote:

> On Sun, 17 Feb 2008 00:43:56 -0500, "Daniel Richard G."
> <skunk at iSKUNK.ORG> wrote:
> > * (various files): Anytime you have a prototype/definition of a
> > function that doesn't take arguments, use (void) instead of ().
> > This eliminates the "function declaration isn't a prototype"
> > warning.
> For some reason some time ago, we stopped using void in empty argument
> lists. Unfortunately, I don't remember why.
> Nick, do you?

Just because it's more typing and I had assumed it wasn't necessary. So
I'm to blame ;-) I even removed them from any patches I applied, oops.

But I guess if it's not portable, we shouldn't use it.

> > The biggest portability issue, however, is one that a patch is not 
> > well-suited to fix: the use of C++-style comments in C code. GCC
> > allows this, but will readily warn that "C++ style comments are not
> > allowed in ISO C90", and Unix compilers almost universally choke on
> > them as a syntax error.

Oh noes ;-) Luckily I mainly use C-style comments. Again I had wrongly
assumed that modern compilers would allow this.

> I know and I know this since I'm using them ;-). The // comments are
> just nicer, shorter and easier to use. I'm just lazy :D.
> I agree it would be better to not use them. 
> We could write a preprocessor macro to transform e.g.
> // some text here
> into
> /* some text here */
> Hehe, this would make me and the compilers happy.

Hmm, I don't think you can do that with the C preprocessor, but probably
you meant using a script.

Regards,
Nick



More information about the Users mailing list