On 21/09/2010 09:23, Simen kjaeraas wrote:
bearophile wrote:
klickverbot:
Are there any cases where (*cast(int*)&someFloat) does not fit the bill?
I am not a C lawyer, but I think that too is undefined in C (and maybe
D too).
From your own link
(http://www.digitalmars.com/webnews/newsgrou
On 21/09/2010 00:27, bearophile wrote:
klickverbot:
Are there any cases where (*cast(int*)&someFloat) does not fit the bill?
I am not a C lawyer, but I think that too is undefined in C (and maybe D too).
Bye,
bearophile
In general, it is definitely undefined behavior in C, but that's becaus
I remember that thread and even replied to it. I didn't see anything where
Walter said Unions behave as C. Nor was there anything where Walter said he
would not define C undefined behavior. All he said was, for the cases
presented, there was no way to define the behavior or didn't know what defi
Hello Don,
BCS wrote:
Hello Don,
How would that work? Can a system store ints big-endian and floats
little-endian?
Not sure. My limited understanding is that with on PowerPC, Altivec
can
use big-endian floats, even when the PPC is set to little-endian mode.
Could be wrong, though.
In any ca
BCS wrote:
Hello Don,
BCS wrote:
Hello Don,
It's going to be implementation defined behaviour (will depend on
endianness)
Does that matter if the members are the same size?
Definitely -- you'll grab the part of the mantissa, instead of the
exponent.
How would that work? Can a system s
Hello Don,
BCS wrote:
Hello Don,
It's going to be implementation defined behaviour (will depend on
endianness)
Does that matter if the members are the same size?
Definitely -- you'll grab the part of the mantissa, instead of the
exponent.
How would that work? Can a system store ints bi
Don:
> It's going to be implementation defined behaviour (will depend on
> endianness) but not undefined behaviour.
> BTW std.math heavily relies on reinterpret casting float->int.
I suggest to add something like a std.traits.ReinterpretCast template to Phobos
and use only it in Phobos modules a
bearophile wrote:
klickverbot:
Are there any cases where (*cast(int*)&someFloat) does not fit the bill?
I am not a C lawyer, but I think that too is undefined in C (and maybe D
too).
From your own link
(http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_
BCS wrote:
Hello Don,
BCS wrote:
Hello bearophile,
Jesse Phillips:
Why not, define the behavior and leave it.
This was the original purpose of my thread, but Walter has explained
me that this is not possible for the unions:
I don't see how those apply to unions.
It's going to be imp
Hello Don,
BCS wrote:
Hello bearophile,
Jesse Phillips:
Why not, define the behavior and leave it.
This was the original purpose of my thread, but Walter has explained
me that this is not possible for the unions:
I don't see how those apply to unions.
It's going to be implementation
BCS wrote:
Hello bearophile,
Jesse Phillips:
Why not, define the behavior and leave it.
This was the original purpose of my thread, but Walter has explained
me that this is not possible for the unions:
I don't see how those apply to unions.
It's going to be implementation defined beha
Hello bearophile,
Jesse Phillips:
Why not, define the behavior and leave it.
This was the original purpose of my thread, but Walter has explained
me that this is not possible for the unions:
I don't see how those apply to unions.
--
... <
Jesse Phillips:
> But where does Walter say Unions act as C in this case?
It was an answer in a thread of mine where I have asked to remove some D
undefined behaviours derived from C.
This is the thread start:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=1
On Monday, September 20, 2010 18:21:53 Jesse Phillips wrote:
> bearophile Wrote:
> > - C Standard says that assigning to one member of a union and then
> > accessing a different member is undefined behaviour. - GCC is a
> > practical compiler, so it has the -fno-strict-aliasing switch, that
> > all
bearophile Wrote:
> - C Standard says that assigning to one member of a union and then accessing
> a different member is undefined behaviour.
> - GCC is a practical compiler, so it has the -fno-strict-aliasing switch,
> that allows to use that trick. See "-Wstrict-aliasing" and:
> http://stackov
klickverbot:
> Are there any cases where (*cast(int*)&someFloat) does not fit the bill?
I am not a C lawyer, but I think that too is undefined in C (and maybe D too).
Bye,
bearophile
On 9/20/10 11:52 PM, bearophile wrote:
Recently Bradley Mitchell in D.learn newsgroup has tried to implement the Quake
fast inverse square root algorithm in D, and has found D lack the C++
reinterpret cast:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_
On Mon, Sep 20, 2010 at 05:52:06PM -0400, bearophile wrote:
> Recently Bradley Mitchell in D.learn newsgroup has tried to implement the
> Quake fast inverse square root algorithm in D, and has found D lack the C++
> reinterpret cast:
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=d
On Reddit I have read some people complain that D2 is a too much complex
language because it has too many features. Feature "count" increases a language
complexity, but most of the complexity comes from other sources, like unwanted
interactions between features, messy feature semantics, unspecif
19 matches
Mail list logo