Andes Workshop

It is currently Sun Sep 19, 2021 5:38 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: strict aliasing
PostPosted: Wed Dec 05, 2012 4:52 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
這裡有一篇深入淺出的文章說明strict aliasing。
http://blog.tinlans.org/2010/01/09/strict-aliasing/


為了避免optimization之後,code錯誤,請不要把pointer做cast。

若一定要做pointer的casting,
則可以用選項-fno-strict-aliasing來避免錯誤,
但是這會造成optimize部份功能沒作用,使得程式碼變大。

結論...請不要對pointer做cast


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group