LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2012, 01:02 AM   #1
mantu55
LQ Newbie
 
Registered: May 2012
Location: Bangalore, India
Posts: 3

Rep: Reputation: Disabled
Smile Data alignment,


Hi,

I am getting the following warning for the below piece of code when I have build using GNU on Linux,

code:
#pragma DATA_ALIGN(hal_firmware_1b7, 32)

where "hal_firmware_1b7" is a array variable of type short and trying to make array should start at 32 byte aligned memory address.

warning: ignoring #pragma DATA_ALIGN

Are there any other alternatives on GNU/Linux to clear this warning?

Regards,
Mahantesh
 
Old 05-24-2012, 01:58 AM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Yes, using __attribute__((aligned (32)) when defining the variable (or a type). See Type Attributes in the GCC documentation for details.
 
1 members found this post helpful.
Old 05-25-2012, 04:21 AM   #3
mantu55
LQ Newbie
 
Registered: May 2012
Location: Bangalore, India
Posts: 3

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by asifkhan View Post
when you are defining the variable check out the command and also use __attribute__((aligned (32))

Thank you very much...

My warnings are cleared by the following changes,

UInt16 hal_firmware_1b7[] __attribute__ ((aligned(32)));

Regards,
Mahantesh
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 64 bit data alignment issue on CentOS 5.7 gcc 4.1.2 rajeshkdugar Programming 9 01-24-2012 12:01 AM
[SOLVED] Alignment of a file vikas027 Programming 4 04-23-2009 06:36 AM
Data Alignment nesta Programming 6 05-01-2007 01:22 PM
about alignment eshwar_ind Programming 5 10-18-2004 08:27 AM
glabels alignment Spaz17 Linux - Software 1 11-28-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration