POV-Ray : Newsgroups : povray.programming : cleaning source code from warnings troubles : cleaning source code from warnings troubles Server Time
28 Jul 2024 08:28:29 EDT (-0400)
  cleaning source code from warnings troubles  
From: ABX
Date: 23 Sep 2002 04:29:02
Message: <28gtou4t56f843790s28f5r236q80k3boi@4ax.com>
C/C++ is not my native platform so playing with patches is not trivial thing
for me. I have (partially) learned it long time ago and now use it only for
POV patching. I'm changing various sourcefiles but I have not natural skill to
select which warning is important. So to extract my own I started to fix
sources to avoid all "built-in" warnings when -Wall setting is used with gcc
3.1 (under DJGPP in my case). I know this effort is nothing becouse POV will
be rewritten but I do it for my knowledge and comfort of compiling. I do all
changes patch-like method controlled with definitions like "#define
AVOID_TYPE_CONVERSION_WARNINGS_PATCH" in frame.h. But I have met two warnings
I can't fix (perhaps there is more but I'm currently did 50% of files). I
looking for help in fixing those warnings:

1. "aggregate has a partly bracketed initializer"

It is reported for line 105 of file_pov.cpp. This line closes definition of
gPOV_File_Extensions array. There is correct number of entries in array
initializer. There is correct number of closing } for {. I have tried to
replace for example every line like:
  { ".jpg",  ".JPG",  ".jpeg", ".JPEG" }, // POV_File_Image_JPEG 
with line like
  { { ".jpg" },  {".JPG"},  {".jpeg"}, {".JPEG"} }, // POV_File_Image_JPEG 
and then compiler reported error instead of warning (sorry, can't recall it's
content here). So how to remove this warning ?

2. "multi-character character constant"

It is reported for some header files like for example povms.h (lines 192-215).
There is a note about this warning in gnu gcc documentation: "Usually they
indicate a typo in the user's code, as they have implementation-defined
values, and should not be used in portable code." Portable code? Hmm, so how
to fix this ?

I have additional platform specific question. I can't write warnings of
compiler with gcc under djgpp to file with simple redirection
  gcc ... > file.txt
It creates file.txt but warnings are outputted to the screen. Is it general
rule for gcc or just problem of djgpp port ? Is there switch in options like
for POV ? I can't find anything like this in documentation. And sorry, I'm not
unixer at all.

ABX


Post a reply to this message

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