POV-Ray : Newsgroups : povray.programming : cleaning source code from warnings troubles : Re: cleaning source code from warnings troubles Server Time
28 Jul 2024 14:25:27 EDT (-0400)
  Re: cleaning source code from warnings troubles  
From: ABX
Date: 30 Sep 2002 03:00:06
Message: <5jsfpuofbifqlq9avonj4mejd3f7siihe0@4ax.com>
On Mon, 23 Sep 2002 10:51:19 +0200, "Thorsten Froehlich" <tho### [at] trfde>
wrote:

>In article <28gtou4t56f843790s28f5r236q80k3boi@4ax.com> , ABX 
><abx### [at] abxartpl>  wrote:
>
> > warnings when -Wall setting is used with gcc
>
> Using all gcc warning is pointless.

But somehow I did it :-)
I have now warning-free version of sources. And now I can say what I changed -
warnings were mostly generated with additions/changes introduced in 3.5. Old
code from 3.1 and earlier versions did not cause warnings usually. I can say
nothing about (x)windows compilation. I did it only with pure dos/unix
compile.

> > 1. "aggregate has a partly bracketed initializer"
>
> No idea what it is complaining about.  The code is perfectly legal.

It is array of structures with one element - array. It have to be "double
bracketed" (is this english correct ?). So instead of:
  { ".jpg",  ".JPG",  ".jpeg", ".JPEG" },
it should be:
  { { ".jpg",  ".JPG",  ".jpeg", ".JPEG" } },

> > 2. "multi-character character constant"
>
> These are nonsensical compiler warnings for perfectly legal and portable
> code as long as the platform being used has 32 bit or bigger ints.

It helped to add definition:

#define FOURCHARS_TO_INT(c1,c2,c3,c4) \
                    (((unsigned long) c1 << 24) | \
                     ((unsigned long) c2 << 16) | \
                     ((unsigned long) c3 << 8 ) | \
                     ((unsigned long) c4      ))

I have additional question. Is this more correct or still valid if I replace
line 1756:
  fprintf(file, "%.8x%.8x\n", h, l);
with line:
  fprintf(file, "%.8lx%.8lx\n", h, l);
?

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.