On 08/30/2010 03:50 PM, Vincent Lefevre wrote:
On 2010-08-30 14:46:57 +0200, Michael Matz wrote:
int x = x;
is the way GCC offers this idiom since about forever, no need for an
attribute. Downthread I see that people worry about this generating an
actual (uninitialized) access to x. They
On 8/31/2010 1:19 AM, Andrew Haley wrote:
On 08/30/2010 03:50 PM, Vincent Lefevre wrote:
On 2010-08-30 14:46:57 +0200, Michael Matz wrote:
int x = x;
is the way GCC offers this idiom since about forever, no need for an
attribute. Downthread I see that people worry about this generating an
Hi,
On Fri, 20 Aug 2010, H.J. Lu wrote:
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary. Is that a good idea to add
int x __attribute__ ((uninitialized));
to tell compiler that it is OK for x to be uninitialized?
int x = x;
is the way GCC offers
On 2010-08-30 14:46:57 +0200, Michael Matz wrote:
int x = x;
is the way GCC offers this idiom since about forever, no need for an
attribute. Downthread I see that people worry about this generating an
actual (uninitialized) access to x. They are confused.
This is not a good idea as int
On Sat, Aug 21, 2010 at 11:43 AM, Florian Weimer f...@deneb.enyo.de wrote:
* H. J. Lu:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary.
I guess the official idiom is
int x = x;
That's what I thought as well, so I am confused.
* H. J. Lu:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary.
I guess the official idiom is
int x = x;
and it is somewhat used in the GNU project although it is not
portable.
...@codesourcery.com]
Sent: Friday, August 20, 2010 7:33 PM
To: H.J. Lu
Cc: Bernd Schmidt; Ian Lance Taylor; GCC Development; Kreitzer, David L;
Girkar, Milind
Subject: Re: Add uninitialized attribute?
H.J. Lu wrote:
void *undef __attribute__ ((uninitialized)); // Or something similar
foo (undef
Mark Mitchell wrote:
Bernd Schmidt wrote:
int x __attribute__ ((uninitialized));
to tell compiler that it is OK for x to be uninitialized?
Better to call it initialized, analogous to attribute used/unused.
I agree.
I think the general idea is reasonable. I also think it might be worth
On 08/21/2010 10:43 AM, Florian Weimer wrote:
* H. J. Lu:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary.
I guess the official idiom is
int x = x;
and it is somewhat used in the GNU project although it is not
portable.
On Sat, Aug 21, 2010 at 8:21 AM, Andrew Haley a...@redhat.com wrote:
Ewww, yuck. I think this'll get a read from uninitialized message from
Valgrind. It's undefined behaviour too.
Not to mention there is a patch to get rid of this idiom and warn
about it even without uninitialized warning.
* Andrew Haley:
On 08/21/2010 10:43 AM, Florian Weimer wrote:
* H. J. Lu:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary.
I guess the official idiom is
int x = x;
and it is somewhat used in the GNU project although it
Kreitzer, David L wrote:
There are some situations where an __undefined__ keyword would be useful
Thanks for the example.
I suppose that in C the natural syntax is a pseudo-function that takes a
type, rather than an object, as an argument:
__undefined__(int)
__undefined__(vector float)
On 10-08-20 15:42 , H.J. Lu wrote:
Hi,
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary. Is that a good idea to add
int x __attribute__ ((uninitialized));
to tell compiler that it is OK for x to be uninitialized?
Seems to me that
H.J. Lu hjl.to...@gmail.com writes:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary. Is that a good idea to add
int x __attribute__ ((uninitialized));
to tell compiler that it is OK for x to be uninitialized?
I think the
On 08/20/2010 10:51 PM, Ian Lance Taylor wrote:
H.J. Lu hjl.to...@gmail.com writes:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary. Is that a good idea to add
int x __attribute__ ((uninitialized));
to tell compiler that it is
On Fri, Aug 20, 2010 at 1:57 PM, Bernd Schmidt ber...@codesourcery.com wrote:
On 08/20/2010 10:51 PM, Ian Lance Taylor wrote:
H.J. Lu hjl.to...@gmail.com writes:
Sometime I have to do
int x = 0;
to silence gcc from uninitialized warnings when I know it is
unnecessary. Is that a good idea
Bernd Schmidt wrote:
int x __attribute__ ((uninitialized));
to tell compiler that it is OK for x to be uninitialized?
Better to call it initialized, analogous to attribute used/unused.
I agree.
I think the general idea is reasonable. I also think it might be worth
spending a few
H.J. Lu wrote:
void *undef __attribute__ ((uninitialized)); // Or something similar
foo (undef);
Compiler can pass some junk to foo.
I don't think that's a very good idea. If we need this, which I doubt,
it should be something like a new __undefined__ keyword, that expands to
an
18 matches
Mail list logo