implicit narrowing conversion.

Joseph S. Myers jsm@polyomino.org.uk
Wed Jun 23 20:40:00 GMT 2004


On Wed, 23 Jun 2004, Adam Sulmicki wrote:

> Is there some example of similar submission which deals with all those
> rules? it is easiest to do by example after all...

There's a proposed patch
<http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00313.html> to the
documentation on contributing that adds some tutorial information about
writing testcases that may be useful.  (Note the subsequent discussion
that dividing feature testcases into a great many files isn't particularly
useful.  You probably want two testcases, gcc.dg/Wconversion-1.c and
gcc.dg/Wconversion-traditional-1.c, the first testing everything in
-Wconversion plus that the various useless warnings, as in bug 6614,
*aren't* any longer generated, the second testing
-Wconversion-traditional.  The suffixed number is because any future tests
should then go in a separate file, which will get the -2.c suffix, to
avoid problems with regression testers when what a testcase tests changes.  
There may be a case for changing the existing Wconversion.c to use
-Wconversion-traditional (to keep what it tests the same as much as
possible) and renaming it to Wconversion-traditional-1.c, the new one
being Wconversion-traditional-2.c.)

> finally do you have idea for some better phrasing than:
> 
> 	warning: real type implicitly converted to integer type
> 
> it seems like using "real" in place of float or double is somewhat
> confuing.

"floating type".  That covers complex types as well (including the case
involving the GNU extension of complex integer types, of a complex
floating type converted to a complex integer one).  Similarly, "complex
type implicitly converted to real type".

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc mailing list