[Geany] [PATCH] Fixes for warnings and portability

Enrico Tröger enrico.troeger at xxxxx
Tue Feb 19 15:27:46 UTC 2008


On Tue, 19 Feb 2008 14:08:28 +0000, Nick Treleaven
<nick.treleaven at btinternet.com> wrote:

> 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.
Ok, so we add them again.
 
> > > 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 was also thinking it causes warnings but no errors.

> > 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.
I forgot the smiley ;-). I was trying to joke...:D.
If we change it, we should really change it and not only fake it for
the compiler.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20080219/e7c6e3c5/attachment.pgp>


More information about the Users mailing list