Friday, July 31, 2020

Digest for comp.lang.c++@googlegroups.com - 12 updates in 4 topics

Scott Newman <scott69@gmail.com>: Jul 31 08:55PM +0200

> However, according to Bo (I have not bothered personally
> investigating this) on precisely those same targets, g++ allocates
> bit-fields the other way around. ...
 
No, it doesn't:
 
struct BF
{
unsigned lo : 16;
unsigned hi : 16;
};
 
void fLo( BF &bf )
{
bf.lo = 0x0102;
}
 
void fHi( BF &bf )
{
bf.hi = 0x0304;
}
 
 
_Z3fLoR2BF:
movl $258, %eax
movw %ax, (%rdi)
ret
 
 
_Z3fHiR2BF:
movl $772, %eax
movw %ax, 2(%rdi)
ret
"Öö Tiib" <ootiib@hot.ee>: Jul 31 01:29PM -0700

On Friday, 31 July 2020 16:00:16 UTC+3, Scott Newman wrote:
 
> I'm neither talking about gcc, nor MSVC or whatever. Regarding the
> placement of bitfields you can simply distinguish between compilers
> for big-endian and little-endian targets.
 
You are deliberately always writing what you know to be wrong because
you hope that then someone will respond saying that it is wrong. What
happened to you? What made you that kind of miserable human being?
Scott Newman <scott69@gmail.com>: Jul 31 11:43PM +0200


> You are deliberately always writing what you know to be wrong because
> you hope that then someone will respond saying that it is wrong. What
> happened to you? What made you that kind of miserable human being?
 
What I said above is 100% right.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 31 11:22PM +0100

On 31/07/2020 21:29, Öö Tiib wrote:
 
> You are deliberately always writing what you know to be wrong because
> you hope that then someone will respond saying that it is wrong. What
> happened to you? What made you that kind of miserable human being?
 
Don't feed the troll.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
RM <robert_magdziarz@wp.pl>: Jul 31 08:17PM +0200

I have problem with my TRACE macro: there's nothing on output.
I have the following definition:
 
#ifdef DEBUG
# ifdef _MSC_VER
# include <windows.h>
# include <sstream>
# define TRACE(x) \
do { \
std::stringstream s; \
s << __FILE__ << " (" << __LINE__ << "), " <<
__FUNCTION__ <<": " << x << std::endl; \
OutputDebugString(s.str().c_str()); \
} while (false)
# define TRACE_IF(b, x) if (b) TRACE(x)
# else
# include <iostream>
# define TRACE(x) std::clog << __FILE__ << " (" << __LINE__ <<
"), " << __FUNCTION__ <<": " << x << std::endl
# define TRACE_IF(b, x) if (b) TRACE(x)
# endif
#else
# define TRACE(x)
# define TRACE_IF(b, x)

No comments: