use of __unaligned on a pointer to pointer

Z

Zorro

Hello every one. Please see if you can help. The question is not about
packing and alignment. It is about the use of qualifier __unaligned on
double indirection.

The line "(*((something**) thing))->member;" works fine on Intel and
Motorola chips and a number of compilers (including GNU). However,
with ARM chip, using Visual C++ it breaks due to datatype
misalignment. The qualifier __unaligned workd fine with one level of
indirection, as in: "((__unaligned something*) thing)->member;" but
it breaks in statement: "(*((__unaligned something**) thing))-

Is this general behavior of __unaligned for C++ language?
Is there a workaround through pointer manipulation?

Thank you very much for your help.
Zorro.
 
Z

Zorro

* Zorro:




There is no such thing as "__unaligned" in the C++ language.

It's a compiler-specific language extension.


Try to ask in a newsgroup that deals with your compiler.

Cheers, & hth.,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

I was hoping an ANSI keyword is somewhat familiar to those using the
language. So, if you do not mind I will wait perhaps someone using my
compiler knows the answer. I hope this does not bother you.

Thanks
Z.
 
I

Ian Collins

*please* don't quote signatures.
I was hoping an ANSI keyword is somewhat familiar to those using the
language. So, if you do not mind I will wait perhaps someone using my
compiler knows the answer. I hope this does not bother you.
You'll have a much shorter wait if you ask in the right place!
 
R

Rolf Magnus

Zorro said:
I was hoping an ANSI keyword is somewhat familiar to those using the
language.

The thing is: This is not an ANSI keyword. It's not defined at all in the
ANSI (or rather ISO/IEC actually) C++ standard, and since this newsgroup is
only about C++ as decribed by that standard, your question is off-topic
here.
So, if you do not mind I will wait perhaps someone using my compiler knows
the answer.

Perhaps maybe there might be. Doesn't change the fact that your chances of
getting an answer are much better if you ask in a newsgroup that deals with
your compiler or the target hardware.
I hope this does not bother you.

Actually, I suspect you don't care at all if it bothers anyone.
 
J

James Kanze

There is no such thing as "__unaligned" in the C++ language.
It's a compiler-specific language extension.
Try to ask in a newsgroup that deals with your compiler.

We can guess, however, that it allows unaligned data accesses.
Which are undefined behavior according to the standard, but will
only slow things down on some hardware, but cause it to crash on
others. So perhaps he also needs to ask in a group specific to
his target hardware.
 
Z

Zorro

We can guess, however, that it allows unaligned data accesses.
Which are undefined behavior according to the standard, but will
only slow things down on some hardware, but cause it to crash on
others.  So perhaps he also needs to ask in a group specific to
his target hardware.

Thanks for your help. I had already posted that in a number of other
places as you are suggesting, and got nothing after a 24-hour period.
So, I thought some C++ expert might have run into it. Evidently not
so.

I did not realize the question would bother anyone. Sorry about that.

Thanks and have a great day.
Z.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top