>> I need full description about the "#pragma section". Tried in google, difficult to digest.
Did you read this ?
http://msdn2.microsoft.com
Main Topics
Browse All TopicsWhat is the purpose of "#pragma section". In two different header files if same '#pragma section' is defined, then what will happen? If we defined in two different header files of same pragma, how to remove it as preprocessor #undef xyz. I am getting following error
typedef char system_name_def[10];
^
"D:\Clearcase\for_os upgrade\mr\smsc\lib/./../e
typedef name has already been declared (with same type)
In file smpdl.h
===========
#pragma section system_name
typedef char system_name_def[10];
I need full description about the "#pragma section". Tried in google, difficult to digest.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> I need full description about the "#pragma section". Tried in google, difficult to digest.
Did you read this ?
http://msdn2.microsoft.com
Answer is depending on the compiler
1)One says: "Writing Interrupt Handlers"
we can create a new named section using the "#pragma section" compiler extension. In order to store something in ROM/FLASH, it must be either code or a const variable otherwise it is stored in RAM. for example
#pragma section CODE=prog2, locate=0xFF0000.
Finally if we want to locate variable out of 64kb memory, this is useful.
2)Another one says:
When variables are defined by using the #pragma section, they are located in the order in which they have been defined.
Example:
#pragma section sdata begin
unsigned short a;
unsigned short b;
unsigned short c;
#pragma section sdata end
Actually I was looking for (2) option.
Thanks for help.
Business Accounts
Answer for Membership
by: abithPosted on 2007-10-24 at 04:31:45ID: 20137836
(1) #pragma once
will include file only once.
(2)
#ifndef __YOURFILE_H
#define __YOURFILE_H
.......all header file codes......
#endif
this avoids 2nd time inclusion of same file.
syntax is :
#pragma pragma-name pragma-arguments
(there are few names for pragma-name, i am not aware of all.)