FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 07-18-2008, 01:37 PM
Bastian Blank
 
Default Bug#485135: To fail or misbehave

On Fri, Jul 18, 2008 at 02:57:58PM +0200, Eduard Bloch wrote:
> > Please explain. In C++ there is no implicit conversion between int and
> > char *.
> Exactly. So if you check the return value then the compiler will fail
> (like in the test case above) and you are lucky to notice the problem.

So it fails, completely, you won't get any result from the compiler.

> But if you don't check it and rely on the function to do what it has
> to do (i.e. write the result into the buffer in the argument) then you
> silently get a buffer with undefined data back (most likely
> unchanged).

No. You have to force the compiler somehow to override the error on the
undefined conversion. This is a bug in your code then.

Bastian

--
Spock: The odds of surviving another attack are 13562190123 to 1, Captain.



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-19-2008, 09:37 PM
Eduard Bloch
 
Default Bug#485135: To fail or misbehave

#include <hallo.h>
* Bastian Blank [Fri, Jul 18 2008, 03:37:39PM]:

> > But if you don't check it and rely on the function to do what it has
> > to do (i.e. write the result into the buffer in the argument) then you
> > silently get a buffer with undefined data back (most likely
> > unchanged).
>
> No. You have to force the compiler somehow to override the error on the
> undefined conversion. This is a bug in your code then.

I sense some misunderstanding... did you miss the "if you don't check
the return code" part?

No conversion happens because there is no conversion to be applied, just
because there is no LVALUE.

Regards,
Eduard.

--
<Salz> jjFux: Ted hieß ja früher auch Walther
<Salz> winkiller: hm... es sind 8... die 7 kandidaten und NOTA
<Madkiss> Ist der jetzt eigentlich eine gespaltene Persönlichkeit, bei der aber
beide Teile bekloppt sind?



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 11:54 AM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org