public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38055] New: key for compilation -Wconversion
@ 2008-11-07 19:26 lisp2d at lisp2d dot net
2009-01-24 1:40 ` [Bug c++/38055] " manu at gcc dot gnu dot org
2009-01-24 6:00 ` lisp2d at lisp2d dot net
0 siblings, 2 replies; 3+ messages in thread
From: lisp2d at lisp2d dot net @ 2008-11-07 19:26 UTC (permalink / raw)
To: gcc-bugs
The key for compilation -Wconversion is very important.
Its absence by default hides programming errors on different platforms.
It is desirable to include this key with the help -Wall.
--
Summary: key for compilation -Wconversion
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38055
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/38055] key for compilation -Wconversion
2008-11-07 19:26 [Bug c++/38055] New: key for compilation -Wconversion lisp2d at lisp2d dot net
@ 2009-01-24 1:40 ` manu at gcc dot gnu dot org
2009-01-24 6:00 ` lisp2d at lisp2d dot net
1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-01-24 1:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from manu at gcc dot gnu dot org 2009-01-24 01:40 -------
Quoting the FAQ at http://gcc.gnu.org/wiki/NewWconversion#faq
Why Wconversion is not enabled by -Wall or at least by -Wextra?
Implicit conversions are very common in C. This tied with the fact that there
is no data-flow in front-ends (see next question) results in hard to avoid
warnings for perfectly working and valid code. Wconversion is designed for a
niche of uses (security audits, porting 32 bit code to 64 bit, etc.) where the
programmer is willing to accept and workaround invalid warnings. Therefore, it
shouldn't be enabled if it is not explicitly requested.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38055
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/38055] key for compilation -Wconversion
2008-11-07 19:26 [Bug c++/38055] New: key for compilation -Wconversion lisp2d at lisp2d dot net
2009-01-24 1:40 ` [Bug c++/38055] " manu at gcc dot gnu dot org
@ 2009-01-24 6:00 ` lisp2d at lisp2d dot net
1 sibling, 0 replies; 3+ messages in thread
From: lisp2d at lisp2d dot net @ 2009-01-24 6:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from lisp2d at lisp2d dot net 2009-01-24 06:00 -------
The niche is selected incorrectly. Basically the considerable quantity of
errors of programming is linked to implicit type conversion.
void insert(char*,char,unsigned int){..}
insert(..,..,size_t);
Example
double d = 1.0;
int i;
i = d;
correctly and necessary to write so:
double d = 1.0;
int i;
i = (int)d;
In the program text this obvious conversion will be visible.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38055
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-24 6:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-07 19:26 [Bug c++/38055] New: key for compilation -Wconversion lisp2d at lisp2d dot net
2009-01-24 1:40 ` [Bug c++/38055] " manu at gcc dot gnu dot org
2009-01-24 6:00 ` lisp2d at lisp2d dot net
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).