Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is #pragma directive?how it is used in the program?
what is its advantages and disadvantages?

Answers were Sorted based on User's Feedback



What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?..

Answer / kapil thakar

#pragma is used to give specific instruction to compiler...
like used only reg bank 3..

then
#pragma BANK_3
used be witten in ur code..

another example..

#pragma worning_3

display worning upto level 3

There are many more pragma dependent on compiler ...

Is This Answer Correct ?    3 Yes 0 No

What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?..

Answer / gg

See may help you some how....Answer with more clarity will
be appreciable.....

#pragma .... are documented in the GCC manual as follows.

#pragma GCC dependency
#pragma GCC dependency allows you to check the relative
dates of the current file and another file. If the other
file is more recent than the current file, a warning is
issued. This is useful if the current file is derived from
the other file, and should be regenerated. The other file is
searched for using the normal include search path. Optional
trailing text can be used to give more information in the
warning message.

#pragma GCC dependency "parse.y"
#pragma GCC dependency "/usr/include/time.h"
rerun fixincludes



#pragma GCC poison
Sometimes, there is an identifier that you want to
remove completely from your program, and make sure that it
never creeps back in. To enforce this, you can poison the
identifier with this pragma. #pragma GCC poison is followed
by a list of identifiers to poison. If any of those
identifiers appears anywhere in the source after the
directive, it is a hard error. For example,

#pragma GCC poison printf sprintf fprintf
sprintf(some_string, "hello");


will produce an error.

If a poisoned identifier appears as part of the
expansion of a macro which was defined before the identifier
was poisoned, it will not cause an error. This lets you
poison an identifier without worrying about system headers
defining macros that use it.

For example,

#define strrchr rindex
#pragma GCC poison rindex
strrchr(some_string, 'h');


will not produce an error.
#pragma GCC system_header
This pragma takes no arguments. It causes the rest of
the code in the current file to be treated as if it came
from a system header

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

difference between loading and linking

1 Answers  


hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????

1 Answers  


To what value do nonglobal variables default? 1) auto 2) register 3) static

4 Answers  


What is clrscr ()?

0 Answers  


wap in c to accept a number display the total count of digit

4 Answers  


Give a fast way to multiply a number by 7

15 Answers   Accenture, Aricent, Microsoft,


what is the use of keyword volatile??

4 Answers   LG Soft,


Is null a keyword in c?

0 Answers  


How does free() know how many bytes to free?

8 Answers  


c program to subtract between two numbers without using '-' sign and subtract function.

1 Answers  


Why is c so popular?

0 Answers  


1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)

12 Answers   Eskom, TCS,


Categories