x86_64-linux-gnu-cpp.info 235 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528
  1. This is x86_64-linux-gnu-cpp.info, produced by makeinfo version 6.7 from
  2. cpp.texi.
  3. Copyright (C) 1987-2019 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation. A copy of
  7. the license is included in the section entitled "GNU Free Documentation
  8. License".
  9. This manual contains no Invariant Sections. The Front-Cover Texts
  10. are (a) (see below), and the Back-Cover Texts are (b) (see below).
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise funds
  16. for GNU development.
  17. INFO-DIR-SECTION Software development
  18. START-INFO-DIR-ENTRY
  19. * x86_64-linux-gnu-cpp: (x86_64-linux-gnu-cpp). The GNU C preprocessor.
  20. END-INFO-DIR-ENTRY
  21. 
  22. File: x86_64-linux-gnu-cpp.info, Node: Top, Next: Overview, Up: (dir)
  23. The C Preprocessor
  24. ******************
  25. The C preprocessor implements the macro language used to transform C,
  26. C++, and Objective-C programs before they are compiled. It can also be
  27. useful on its own.
  28. * Menu:
  29. * Overview::
  30. * Header Files::
  31. * Macros::
  32. * Conditionals::
  33. * Diagnostics::
  34. * Line Control::
  35. * Pragmas::
  36. * Other Directives::
  37. * Preprocessor Output::
  38. * Traditional Mode::
  39. * Implementation Details::
  40. * Invocation::
  41. * Environment Variables::
  42. * GNU Free Documentation License::
  43. * Index of Directives::
  44. * Option Index::
  45. * Concept Index::
  46. -- The Detailed Node Listing --
  47. Overview
  48. * Character sets::
  49. * Initial processing::
  50. * Tokenization::
  51. * The preprocessing language::
  52. Header Files
  53. * Include Syntax::
  54. * Include Operation::
  55. * Search Path::
  56. * Once-Only Headers::
  57. * Alternatives to Wrapper #ifndef::
  58. * Computed Includes::
  59. * Wrapper Headers::
  60. * System Headers::
  61. Macros
  62. * Object-like Macros::
  63. * Function-like Macros::
  64. * Macro Arguments::
  65. * Stringizing::
  66. * Concatenation::
  67. * Variadic Macros::
  68. * Predefined Macros::
  69. * Undefining and Redefining Macros::
  70. * Directives Within Macro Arguments::
  71. * Macro Pitfalls::
  72. Predefined Macros
  73. * Standard Predefined Macros::
  74. * Common Predefined Macros::
  75. * System-specific Predefined Macros::
  76. * C++ Named Operators::
  77. Macro Pitfalls
  78. * Misnesting::
  79. * Operator Precedence Problems::
  80. * Swallowing the Semicolon::
  81. * Duplication of Side Effects::
  82. * Self-Referential Macros::
  83. * Argument Prescan::
  84. * Newlines in Arguments::
  85. Conditionals
  86. * Conditional Uses::
  87. * Conditional Syntax::
  88. * Deleted Code::
  89. Conditional Syntax
  90. * Ifdef::
  91. * If::
  92. * Defined::
  93. * Else::
  94. * Elif::
  95. Implementation Details
  96. * Implementation-defined behavior::
  97. * Implementation limits::
  98. * Obsolete Features::
  99. Obsolete Features
  100. * Obsolete Features::
  101. Copyright (C) 1987-2019 Free Software Foundation, Inc.
  102. Permission is granted to copy, distribute and/or modify this document
  103. under the terms of the GNU Free Documentation License, Version 1.3 or
  104. any later version published by the Free Software Foundation. A copy of
  105. the license is included in the section entitled "GNU Free Documentation
  106. License".
  107. This manual contains no Invariant Sections. The Front-Cover Texts
  108. are (a) (see below), and the Back-Cover Texts are (b) (see below).
  109. (a) The FSF's Front-Cover Text is:
  110. A GNU Manual
  111. (b) The FSF's Back-Cover Text is:
  112. You have freedom to copy and modify this GNU Manual, like GNU
  113. software. Copies published by the Free Software Foundation raise funds
  114. for GNU development.
  115. 
  116. File: x86_64-linux-gnu-cpp.info, Node: Overview, Next: Header Files, Prev: Top, Up: Top
  117. 1 Overview
  118. **********
  119. The C preprocessor, often known as "cpp", is a "macro processor" that is
  120. used automatically by the C compiler to transform your program before
  121. compilation. It is called a macro processor because it allows you to
  122. define "macros", which are brief abbreviations for longer constructs.
  123. The C preprocessor is intended to be used only with C, C++, and
  124. Objective-C source code. In the past, it has been abused as a general
  125. text processor. It will choke on input which does not obey C's lexical
  126. rules. For example, apostrophes will be interpreted as the beginning of
  127. character constants, and cause errors. Also, you cannot rely on it
  128. preserving characteristics of the input which are not significant to
  129. C-family languages. If a Makefile is preprocessed, all the hard tabs
  130. will be removed, and the Makefile will not work.
  131. Having said that, you can often get away with using cpp on things
  132. which are not C. Other Algol-ish programming languages are often safe
  133. (Ada, etc.) So is assembly, with caution. '-traditional-cpp' mode
  134. preserves more white space, and is otherwise more permissive. Many of
  135. the problems can be avoided by writing C or C++ style comments instead
  136. of native language comments, and keeping macros simple.
  137. Wherever possible, you should use a preprocessor geared to the
  138. language you are writing in. Modern versions of the GNU assembler have
  139. macro facilities. Most high level programming languages have their own
  140. conditional compilation and inclusion mechanism. If all else fails, try
  141. a true general text processor, such as GNU M4.
  142. C preprocessors vary in some details. This manual discusses the GNU
  143. C preprocessor, which provides a small superset of the features of ISO
  144. Standard C. In its default mode, the GNU C preprocessor does not do a
  145. few things required by the standard. These are features which are
  146. rarely, if ever, used, and may cause surprising changes to the meaning
  147. of a program which does not expect them. To get strict ISO Standard C,
  148. you should use the '-std=c90', '-std=c99', '-std=c11' or '-std=c17'
  149. options, depending on which version of the standard you want. To get
  150. all the mandatory diagnostics, you must also use '-pedantic'. *Note
  151. Invocation::.
  152. This manual describes the behavior of the ISO preprocessor. To
  153. minimize gratuitous differences, where the ISO preprocessor's behavior
  154. does not conflict with traditional semantics, the traditional
  155. preprocessor should behave the same way. The various differences that
  156. do exist are detailed in the section *note Traditional Mode::.
  157. For clarity, unless noted otherwise, references to 'CPP' in this
  158. manual refer to GNU CPP.
  159. * Menu:
  160. * Character sets::
  161. * Initial processing::
  162. * Tokenization::
  163. * The preprocessing language::
  164. 
  165. File: x86_64-linux-gnu-cpp.info, Node: Character sets, Next: Initial processing, Up: Overview
  166. 1.1 Character sets
  167. ==================
  168. Source code character set processing in C and related languages is
  169. rather complicated. The C standard discusses two character sets, but
  170. there are really at least four.
  171. The files input to CPP might be in any character set at all. CPP's
  172. very first action, before it even looks for line boundaries, is to
  173. convert the file into the character set it uses for internal processing.
  174. That set is what the C standard calls the "source" character set. It
  175. must be isomorphic with ISO 10646, also known as Unicode. CPP uses the
  176. UTF-8 encoding of Unicode.
  177. The character sets of the input files are specified using the
  178. '-finput-charset=' option.
  179. All preprocessing work (the subject of the rest of this manual) is
  180. carried out in the source character set. If you request textual output
  181. from the preprocessor with the '-E' option, it will be in UTF-8.
  182. After preprocessing is complete, string and character constants are
  183. converted again, into the "execution" character set. This character set
  184. is under control of the user; the default is UTF-8, matching the source
  185. character set. Wide string and character constants have their own
  186. character set, which is not called out specifically in the standard.
  187. Again, it is under control of the user. The default is UTF-16 or
  188. UTF-32, whichever fits in the target's 'wchar_t' type, in the target
  189. machine's byte order.(1) Octal and hexadecimal escape sequences do not
  190. undergo conversion; '\x12' has the value 0x12 regardless of the
  191. currently selected execution character set. All other escapes are
  192. replaced by the character in the source character set that they
  193. represent, then converted to the execution character set, just like
  194. unescaped characters.
  195. In identifiers, characters outside the ASCII range can only be
  196. specified with the '\u' and '\U' escapes, not used directly. If strict
  197. ISO C90 conformance is specified with an option such as '-std=c90', or
  198. '-fno-extended-identifiers' is used, then those escapes are not
  199. permitted in identifiers.
  200. ---------- Footnotes ----------
  201. (1) UTF-16 does not meet the requirements of the C standard for a
  202. wide character set, but the choice of 16-bit 'wchar_t' is enshrined in
  203. some system ABIs so we cannot fix this.
  204. 
  205. File: x86_64-linux-gnu-cpp.info, Node: Initial processing, Next: Tokenization, Prev: Character sets, Up: Overview
  206. 1.2 Initial processing
  207. ======================
  208. The preprocessor performs a series of textual transformations on its
  209. input. These happen before all other processing. Conceptually, they
  210. happen in a rigid order, and the entire file is run through each
  211. transformation before the next one begins. CPP actually does them all
  212. at once, for performance reasons. These transformations correspond
  213. roughly to the first three "phases of translation" described in the C
  214. standard.
  215. 1. The input file is read into memory and broken into lines.
  216. Different systems use different conventions to indicate the end of
  217. a line. GCC accepts the ASCII control sequences 'LF', 'CR LF' and
  218. 'CR' as end-of-line markers. These are the canonical sequences
  219. used by Unix, DOS and VMS, and the classic Mac OS (before OSX)
  220. respectively. You may therefore safely copy source code written on
  221. any of those systems to a different one and use it without
  222. conversion. (GCC may lose track of the current line number if a
  223. file doesn't consistently use one convention, as sometimes happens
  224. when it is edited on computers with different conventions that
  225. share a network file system.)
  226. If the last line of any input file lacks an end-of-line marker, the
  227. end of the file is considered to implicitly supply one. The C
  228. standard says that this condition provokes undefined behavior, so
  229. GCC will emit a warning message.
  230. 2. If trigraphs are enabled, they are replaced by their corresponding
  231. single characters. By default GCC ignores trigraphs, but if you
  232. request a strictly conforming mode with the '-std' option, or you
  233. specify the '-trigraphs' option, then it converts them.
  234. These are nine three-character sequences, all starting with '??',
  235. that are defined by ISO C to stand for single characters. They
  236. permit obsolete systems that lack some of C's punctuation to use C.
  237. For example, '??/' stands for '\', so '??/n' is a character
  238. constant for a newline.
  239. Trigraphs are not popular and many compilers implement them
  240. incorrectly. Portable code should not rely on trigraphs being
  241. either converted or ignored. With '-Wtrigraphs' GCC will warn you
  242. when a trigraph may change the meaning of your program if it were
  243. converted. *Note Wtrigraphs::.
  244. In a string constant, you can prevent a sequence of question marks
  245. from being confused with a trigraph by inserting a backslash
  246. between the question marks, or by separating the string literal at
  247. the trigraph and making use of string literal concatenation.
  248. "(??\?)" is the string '(???)', not '(?]'. Traditional C compilers
  249. do not recognize these idioms.
  250. The nine trigraphs and their replacements are
  251. Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
  252. Replacement: [ ] { } # \ ^ | ~
  253. 3. Continued lines are merged into one long line.
  254. A continued line is a line which ends with a backslash, '\'. The
  255. backslash is removed and the following line is joined with the
  256. current one. No space is inserted, so you may split a line
  257. anywhere, even in the middle of a word. (It is generally more
  258. readable to split lines only at white space.)
  259. The trailing backslash on a continued line is commonly referred to
  260. as a "backslash-newline".
  261. If there is white space between a backslash and the end of a line,
  262. that is still a continued line. However, as this is usually the
  263. result of an editing mistake, and many compilers will not accept it
  264. as a continued line, GCC will warn you about it.
  265. 4. All comments are replaced with single spaces.
  266. There are two kinds of comments. "Block comments" begin with '/*'
  267. and continue until the next '*/'. Block comments do not nest:
  268. /* this is /* one comment */ text outside comment
  269. "Line comments" begin with '//' and continue to the end of the
  270. current line. Line comments do not nest either, but it does not
  271. matter, because they would end in the same place anyway.
  272. // this is // one comment
  273. text outside comment
  274. It is safe to put line comments inside block comments, or vice versa.
  275. /* block comment
  276. // contains line comment
  277. yet more comment
  278. */ outside comment
  279. // line comment /* contains block comment */
  280. But beware of commenting out one end of a block comment with a line
  281. comment.
  282. // l.c. /* block comment begins
  283. oops! this isn't a comment anymore */
  284. Comments are not recognized within string literals. "/* blah */" is
  285. the string constant '/* blah */', not an empty string.
  286. Line comments are not in the 1989 edition of the C standard, but they
  287. are recognized by GCC as an extension. In C++ and in the 1999 edition
  288. of the C standard, they are an official part of the language.
  289. Since these transformations happen before all other processing, you
  290. can split a line mechanically with backslash-newline anywhere. You can
  291. comment out the end of a line. You can continue a line comment onto the
  292. next line with backslash-newline. You can even split '/*', '*/', and
  293. '//' onto multiple lines with backslash-newline. For example:
  294. /\
  295. *
  296. */ # /*
  297. */ defi\
  298. ne FO\
  299. O 10\
  300. 20
  301. is equivalent to '#define FOO 1020'. All these tricks are extremely
  302. confusing and should not be used in code intended to be readable.
  303. There is no way to prevent a backslash at the end of a line from
  304. being interpreted as a backslash-newline. This cannot affect any
  305. correct program, however.
  306. 
  307. File: x86_64-linux-gnu-cpp.info, Node: Tokenization, Next: The preprocessing language, Prev: Initial processing, Up: Overview
  308. 1.3 Tokenization
  309. ================
  310. After the textual transformations are finished, the input file is
  311. converted into a sequence of "preprocessing tokens". These mostly
  312. correspond to the syntactic tokens used by the C compiler, but there are
  313. a few differences. White space separates tokens; it is not itself a
  314. token of any kind. Tokens do not have to be separated by white space,
  315. but it is often necessary to avoid ambiguities.
  316. When faced with a sequence of characters that has more than one
  317. possible tokenization, the preprocessor is greedy. It always makes each
  318. token, starting from the left, as big as possible before moving on to
  319. the next token. For instance, 'a+++++b' is interpreted as
  320. 'a ++ ++ + b', not as 'a ++ + ++ b', even though the latter tokenization
  321. could be part of a valid C program and the former could not.
  322. Once the input file is broken into tokens, the token boundaries never
  323. change, except when the '##' preprocessing operator is used to paste
  324. tokens together. *Note Concatenation::. For example,
  325. #define foo() bar
  326. foo()baz
  327. ==> bar baz
  328. _not_
  329. ==> barbaz
  330. The compiler does not re-tokenize the preprocessor's output. Each
  331. preprocessing token becomes one compiler token.
  332. Preprocessing tokens fall into five broad classes: identifiers,
  333. preprocessing numbers, string literals, punctuators, and other. An
  334. "identifier" is the same as an identifier in C: any sequence of letters,
  335. digits, or underscores, which begins with a letter or underscore.
  336. Keywords of C have no significance to the preprocessor; they are
  337. ordinary identifiers. You can define a macro whose name is a keyword,
  338. for instance. The only identifier which can be considered a
  339. preprocessing keyword is 'defined'. *Note Defined::.
  340. This is mostly true of other languages which use the C preprocessor.
  341. However, a few of the keywords of C++ are significant even in the
  342. preprocessor. *Note C++ Named Operators::.
  343. In the 1999 C standard, identifiers may contain letters which are not
  344. part of the "basic source character set", at the implementation's
  345. discretion (such as accented Latin letters, Greek letters, or Chinese
  346. ideograms). This may be done with an extended character set, or the
  347. '\u' and '\U' escape sequences. GCC only accepts such characters in the
  348. '\u' and '\U' forms.
  349. As an extension, GCC treats '$' as a letter. This is for
  350. compatibility with some systems, such as VMS, where '$' is commonly used
  351. in system-defined function and object names. '$' is not a letter in
  352. strictly conforming mode, or if you specify the '-$' option. *Note
  353. Invocation::.
  354. A "preprocessing number" has a rather bizarre definition. The
  355. category includes all the normal integer and floating point constants
  356. one expects of C, but also a number of other things one might not
  357. initially recognize as a number. Formally, preprocessing numbers begin
  358. with an optional period, a required decimal digit, and then continue
  359. with any sequence of letters, digits, underscores, periods, and
  360. exponents. Exponents are the two-character sequences 'e+', 'e-', 'E+',
  361. 'E-', 'p+', 'p-', 'P+', and 'P-'. (The exponents that begin with 'p' or
  362. 'P' are used for hexadecimal floating-point constants.)
  363. The purpose of this unusual definition is to isolate the preprocessor
  364. from the full complexity of numeric constants. It does not have to
  365. distinguish between lexically valid and invalid floating-point numbers,
  366. which is complicated. The definition also permits you to split an
  367. identifier at any position and get exactly two tokens, which can then be
  368. pasted back together with the '##' operator.
  369. It's possible for preprocessing numbers to cause programs to be
  370. misinterpreted. For example, '0xE+12' is a preprocessing number which
  371. does not translate to any valid numeric constant, therefore a syntax
  372. error. It does not mean '0xE + 12', which is what you might have
  373. intended.
  374. "String literals" are string constants, character constants, and
  375. header file names (the argument of '#include').(1) String constants and
  376. character constants are straightforward: "..." or '...'. In either case
  377. embedded quotes should be escaped with a backslash: '\'' is the
  378. character constant for '''. There is no limit on the length of a
  379. character constant, but the value of a character constant that contains
  380. more than one character is implementation-defined. *Note Implementation
  381. Details::.
  382. Header file names either look like string constants, "...", or are
  383. written with angle brackets instead, <...>. In either case, backslash
  384. is an ordinary character. There is no way to escape the closing quote
  385. or angle bracket. The preprocessor looks for the header file in
  386. different places depending on which form you use. *Note Include
  387. Operation::.
  388. No string literal may extend past the end of a line. You may use
  389. continued lines instead, or string constant concatenation.
  390. "Punctuators" are all the usual bits of punctuation which are
  391. meaningful to C and C++. All but three of the punctuation characters in
  392. ASCII are C punctuators. The exceptions are '@', '$', and '`'. In
  393. addition, all the two- and three-character operators are punctuators.
  394. There are also six "digraphs", which the C++ standard calls "alternative
  395. tokens", which are merely alternate ways to spell other punctuators.
  396. This is a second attempt to work around missing punctuation in obsolete
  397. systems. It has no negative side effects, unlike trigraphs, but does
  398. not cover as much ground. The digraphs and their corresponding normal
  399. punctuators are:
  400. Digraph: <% %> <: :> %: %:%:
  401. Punctuator: { } [ ] # ##
  402. Any other single character is considered "other". It is passed on to
  403. the preprocessor's output unmolested. The C compiler will almost
  404. certainly reject source code containing "other" tokens. In ASCII, the
  405. only other characters are '@', '$', '`', and control characters other
  406. than NUL (all bits zero). (Note that '$' is normally considered a
  407. letter.) All characters with the high bit set (numeric range 0x7F-0xFF)
  408. are also "other" in the present implementation. This will change when
  409. proper support for international character sets is added to GCC.
  410. NUL is a special case because of the high probability that its
  411. appearance is accidental, and because it may be invisible to the user
  412. (many terminals do not display NUL at all). Within comments, NULs are
  413. silently ignored, just as any other character would be. In running
  414. text, NUL is considered white space. For example, these two directives
  415. have the same meaning.
  416. #define X^@1
  417. #define X 1
  418. (where '^@' is ASCII NUL). Within string or character constants, NULs
  419. are preserved. In the latter two cases the preprocessor emits a warning
  420. message.
  421. ---------- Footnotes ----------
  422. (1) The C standard uses the term "string literal" to refer only to
  423. what we are calling "string constants".
  424. 
  425. File: x86_64-linux-gnu-cpp.info, Node: The preprocessing language, Prev: Tokenization, Up: Overview
  426. 1.4 The preprocessing language
  427. ==============================
  428. After tokenization, the stream of tokens may simply be passed straight
  429. to the compiler's parser. However, if it contains any operations in the
  430. "preprocessing language", it will be transformed first. This stage
  431. corresponds roughly to the standard's "translation phase 4" and is what
  432. most people think of as the preprocessor's job.
  433. The preprocessing language consists of "directives" to be executed
  434. and "macros" to be expanded. Its primary capabilities are:
  435. * Inclusion of header files. These are files of declarations that
  436. can be substituted into your program.
  437. * Macro expansion. You can define "macros", which are abbreviations
  438. for arbitrary fragments of C code. The preprocessor will replace
  439. the macros with their definitions throughout the program. Some
  440. macros are automatically defined for you.
  441. * Conditional compilation. You can include or exclude parts of the
  442. program according to various conditions.
  443. * Line control. If you use a program to combine or rearrange source
  444. files into an intermediate file which is then compiled, you can use
  445. line control to inform the compiler where each source line
  446. originally came from.
  447. * Diagnostics. You can detect problems at compile time and issue
  448. errors or warnings.
  449. There are a few more, less useful, features.
  450. Except for expansion of predefined macros, all these operations are
  451. triggered with "preprocessing directives". Preprocessing directives are
  452. lines in your program that start with '#'. Whitespace is allowed before
  453. and after the '#'. The '#' is followed by an identifier, the "directive
  454. name". It specifies the operation to perform. Directives are commonly
  455. referred to as '#NAME' where NAME is the directive name. For example,
  456. '#define' is the directive that defines a macro.
  457. The '#' which begins a directive cannot come from a macro expansion.
  458. Also, the directive name is not macro expanded. Thus, if 'foo' is
  459. defined as a macro expanding to 'define', that does not make '#foo' a
  460. valid preprocessing directive.
  461. The set of valid directive names is fixed. Programs cannot define
  462. new preprocessing directives.
  463. Some directives require arguments; these make up the rest of the
  464. directive line and must be separated from the directive name by
  465. whitespace. For example, '#define' must be followed by a macro name and
  466. the intended expansion of the macro.
  467. A preprocessing directive cannot cover more than one line. The line
  468. may, however, be continued with backslash-newline, or by a block comment
  469. which extends past the end of the line. In either case, when the
  470. directive is processed, the continuations have already been merged with
  471. the first line to make one long line.
  472. 
  473. File: x86_64-linux-gnu-cpp.info, Node: Header Files, Next: Macros, Prev: Overview, Up: Top
  474. 2 Header Files
  475. **************
  476. A header file is a file containing C declarations and macro definitions
  477. (*note Macros::) to be shared between several source files. You request
  478. the use of a header file in your program by "including" it, with the C
  479. preprocessing directive '#include'.
  480. Header files serve two purposes.
  481. * System header files declare the interfaces to parts of the
  482. operating system. You include them in your program to supply the
  483. definitions and declarations you need to invoke system calls and
  484. libraries.
  485. * Your own header files contain declarations for interfaces between
  486. the source files of your program. Each time you have a group of
  487. related declarations and macro definitions all or most of which are
  488. needed in several different source files, it is a good idea to
  489. create a header file for them.
  490. Including a header file produces the same results as copying the
  491. header file into each source file that needs it. Such copying would be
  492. time-consuming and error-prone. With a header file, the related
  493. declarations appear in only one place. If they need to be changed, they
  494. can be changed in one place, and programs that include the header file
  495. will automatically use the new version when next recompiled. The header
  496. file eliminates the labor of finding and changing all the copies as well
  497. as the risk that a failure to find one copy will result in
  498. inconsistencies within a program.
  499. In C, the usual convention is to give header files names that end
  500. with '.h'. It is most portable to use only letters, digits, dashes, and
  501. underscores in header file names, and at most one dot.
  502. * Menu:
  503. * Include Syntax::
  504. * Include Operation::
  505. * Search Path::
  506. * Once-Only Headers::
  507. * Alternatives to Wrapper #ifndef::
  508. * Computed Includes::
  509. * Wrapper Headers::
  510. * System Headers::
  511. 
  512. File: x86_64-linux-gnu-cpp.info, Node: Include Syntax, Next: Include Operation, Up: Header Files
  513. 2.1 Include Syntax
  514. ==================
  515. Both user and system header files are included using the preprocessing
  516. directive '#include'. It has two variants:
  517. '#include <FILE>'
  518. This variant is used for system header files. It searches for a
  519. file named FILE in a standard list of system directories. You can
  520. prepend directories to this list with the '-I' option (*note
  521. Invocation::).
  522. '#include "FILE"'
  523. This variant is used for header files of your own program. It
  524. searches for a file named FILE first in the directory containing
  525. the current file, then in the quote directories and then the same
  526. directories used for '<FILE>'. You can prepend directories to the
  527. list of quote directories with the '-iquote' option.
  528. The argument of '#include', whether delimited with quote marks or
  529. angle brackets, behaves like a string constant in that comments are not
  530. recognized, and macro names are not expanded. Thus, '#include <x/*y>'
  531. specifies inclusion of a system header file named 'x/*y'.
  532. However, if backslashes occur within FILE, they are considered
  533. ordinary text characters, not escape characters. None of the character
  534. escape sequences appropriate to string constants in C are processed.
  535. Thus, '#include "x\n\\y"' specifies a filename containing three
  536. backslashes. (Some systems interpret '\' as a pathname separator. All
  537. of these also interpret '/' the same way. It is most portable to use
  538. only '/'.)
  539. It is an error if there is anything (other than comments) on the line
  540. after the file name.
  541. 
  542. File: x86_64-linux-gnu-cpp.info, Node: Include Operation, Next: Search Path, Prev: Include Syntax, Up: Header Files
  543. 2.2 Include Operation
  544. =====================
  545. The '#include' directive works by directing the C preprocessor to scan
  546. the specified file as input before continuing with the rest of the
  547. current file. The output from the preprocessor contains the output
  548. already generated, followed by the output resulting from the included
  549. file, followed by the output that comes from the text after the
  550. '#include' directive. For example, if you have a header file 'header.h'
  551. as follows,
  552. char *test (void);
  553. and a main program called 'program.c' that uses the header file, like
  554. this,
  555. int x;
  556. #include "header.h"
  557. int
  558. main (void)
  559. {
  560. puts (test ());
  561. }
  562. the compiler will see the same token stream as it would if 'program.c'
  563. read
  564. int x;
  565. char *test (void);
  566. int
  567. main (void)
  568. {
  569. puts (test ());
  570. }
  571. Included files are not limited to declarations and macro definitions;
  572. those are merely the typical uses. Any fragment of a C program can be
  573. included from another file. The include file could even contain the
  574. beginning of a statement that is concluded in the containing file, or
  575. the end of a statement that was started in the including file. However,
  576. an included file must consist of complete tokens. Comments and string
  577. literals which have not been closed by the end of an included file are
  578. invalid. For error recovery, they are considered to end at the end of
  579. the file.
  580. To avoid confusion, it is best if header files contain only complete
  581. syntactic units--function declarations or definitions, type
  582. declarations, etc.
  583. The line following the '#include' directive is always treated as a
  584. separate line by the C preprocessor, even if the included file lacks a
  585. final newline.
  586. 
  587. File: x86_64-linux-gnu-cpp.info, Node: Search Path, Next: Once-Only Headers, Prev: Include Operation, Up: Header Files
  588. 2.3 Search Path
  589. ===============
  590. By default, the preprocessor looks for header files included by the
  591. quote form of the directive '#include "FILE"' first relative to the
  592. directory of the current file, and then in a preconfigured list of
  593. standard system directories. For example, if '/usr/include/sys/stat.h'
  594. contains '#include "types.h"', GCC looks for 'types.h' first in
  595. '/usr/include/sys', then in its usual search path.
  596. For the angle-bracket form '#include <FILE>', the preprocessor's
  597. default behavior is to look only in the standard system directories.
  598. The exact search directory list depends on the target system, how GCC is
  599. configured, and where it is installed. You can find the default search
  600. directory list for your version of CPP by invoking it with the '-v'
  601. option. For example,
  602. cpp -v /dev/null -o /dev/null
  603. There are a number of command-line options you can use to add
  604. additional directories to the search path. The most commonly-used
  605. option is '-IDIR', which causes DIR to be searched after the current
  606. directory (for the quote form of the directive) and ahead of the
  607. standard system directories. You can specify multiple '-I' options on
  608. the command line, in which case the directories are searched in
  609. left-to-right order.
  610. If you need separate control over the search paths for the quote and
  611. angle-bracket forms of the '#include' directive, you can use the
  612. '-iquote' and/or '-isystem' options instead of '-I'. *Note
  613. Invocation::, for a detailed description of these options, as well as
  614. others that are less generally useful.
  615. If you specify other options on the command line, such as '-I', that
  616. affect where the preprocessor searches for header files, the directory
  617. list printed by the '-v' option reflects the actual search path used by
  618. the preprocessor.
  619. Note that you can also prevent the preprocessor from searching any of
  620. the default system header directories with the '-nostdinc' option. This
  621. is useful when you are compiling an operating system kernel or some
  622. other program that does not use the standard C library facilities, or
  623. the standard C library itself.
  624. 
  625. File: x86_64-linux-gnu-cpp.info, Node: Once-Only Headers, Next: Alternatives to Wrapper #ifndef, Prev: Search Path, Up: Header Files
  626. 2.4 Once-Only Headers
  627. =====================
  628. If a header file happens to be included twice, the compiler will process
  629. its contents twice. This is very likely to cause an error, e.g. when
  630. the compiler sees the same structure definition twice. Even if it does
  631. not, it will certainly waste time.
  632. The standard way to prevent this is to enclose the entire real
  633. contents of the file in a conditional, like this:
  634. /* File foo. */
  635. #ifndef FILE_FOO_SEEN
  636. #define FILE_FOO_SEEN
  637. THE ENTIRE FILE
  638. #endif /* !FILE_FOO_SEEN */
  639. This construct is commonly known as a "wrapper #ifndef". When the
  640. header is included again, the conditional will be false, because
  641. 'FILE_FOO_SEEN' is defined. The preprocessor will skip over the entire
  642. contents of the file, and the compiler will not see it twice.
  643. CPP optimizes even further. It remembers when a header file has a
  644. wrapper '#ifndef'. If a subsequent '#include' specifies that header,
  645. and the macro in the '#ifndef' is still defined, it does not bother to
  646. rescan the file at all.
  647. You can put comments outside the wrapper. They will not interfere
  648. with this optimization.
  649. The macro 'FILE_FOO_SEEN' is called the "controlling macro" or "guard
  650. macro". In a user header file, the macro name should not begin with
  651. '_'. In a system header file, it should begin with '__' to avoid
  652. conflicts with user programs. In any kind of header file, the macro
  653. name should contain the name of the file and some additional text, to
  654. avoid conflicts with other header files.
  655. 
  656. File: x86_64-linux-gnu-cpp.info, Node: Alternatives to Wrapper #ifndef, Next: Computed Includes, Prev: Once-Only Headers, Up: Header Files
  657. 2.5 Alternatives to Wrapper #ifndef
  658. ===================================
  659. CPP supports two more ways of indicating that a header file should be
  660. read only once. Neither one is as portable as a wrapper '#ifndef' and
  661. we recommend you do not use them in new programs, with the caveat that
  662. '#import' is standard practice in Objective-C.
  663. CPP supports a variant of '#include' called '#import' which includes
  664. a file, but does so at most once. If you use '#import' instead of
  665. '#include', then you don't need the conditionals inside the header file
  666. to prevent multiple inclusion of the contents. '#import' is standard in
  667. Objective-C, but is considered a deprecated extension in C and C++.
  668. '#import' is not a well designed feature. It requires the users of a
  669. header file to know that it should only be included once. It is much
  670. better for the header file's implementor to write the file so that users
  671. don't need to know this. Using a wrapper '#ifndef' accomplishes this
  672. goal.
  673. In the present implementation, a single use of '#import' will prevent
  674. the file from ever being read again, by either '#import' or '#include'.
  675. You should not rely on this; do not use both '#import' and '#include' to
  676. refer to the same header file.
  677. Another way to prevent a header file from being included more than
  678. once is with the '#pragma once' directive (*note Pragmas::). '#pragma
  679. once' does not have the problems that '#import' does, but it is not
  680. recognized by all preprocessors, so you cannot rely on it in a portable
  681. program.
  682. 
  683. File: x86_64-linux-gnu-cpp.info, Node: Computed Includes, Next: Wrapper Headers, Prev: Alternatives to Wrapper #ifndef, Up: Header Files
  684. 2.6 Computed Includes
  685. =====================
  686. Sometimes it is necessary to select one of several different header
  687. files to be included into your program. They might specify
  688. configuration parameters to be used on different sorts of operating
  689. systems, for instance. You could do this with a series of conditionals,
  690. #if SYSTEM_1
  691. # include "system_1.h"
  692. #elif SYSTEM_2
  693. # include "system_2.h"
  694. #elif SYSTEM_3
  695. ...
  696. #endif
  697. That rapidly becomes tedious. Instead, the preprocessor offers the
  698. ability to use a macro for the header name. This is called a "computed
  699. include". Instead of writing a header name as the direct argument of
  700. '#include', you simply put a macro name there instead:
  701. #define SYSTEM_H "system_1.h"
  702. ...
  703. #include SYSTEM_H
  704. 'SYSTEM_H' will be expanded, and the preprocessor will look for
  705. 'system_1.h' as if the '#include' had been written that way originally.
  706. 'SYSTEM_H' could be defined by your Makefile with a '-D' option.
  707. You must be careful when you define the macro. '#define' saves
  708. tokens, not text. The preprocessor has no way of knowing that the macro
  709. will be used as the argument of '#include', so it generates ordinary
  710. tokens, not a header name. This is unlikely to cause problems if you
  711. use double-quote includes, which are close enough to string constants.
  712. If you use angle brackets, however, you may have trouble.
  713. The syntax of a computed include is actually a bit more general than
  714. the above. If the first non-whitespace character after '#include' is
  715. not '"' or '<', then the entire line is macro-expanded like running text
  716. would be.
  717. If the line expands to a single string constant, the contents of that
  718. string constant are the file to be included. CPP does not re-examine
  719. the string for embedded quotes, but neither does it process backslash
  720. escapes in the string. Therefore
  721. #define HEADER "a\"b"
  722. #include HEADER
  723. looks for a file named 'a\"b'. CPP searches for the file according to
  724. the rules for double-quoted includes.
  725. If the line expands to a token stream beginning with a '<' token and
  726. including a '>' token, then the tokens between the '<' and the first '>'
  727. are combined to form the filename to be included. Any whitespace
  728. between tokens is reduced to a single space; then any space after the
  729. initial '<' is retained, but a trailing space before the closing '>' is
  730. ignored. CPP searches for the file according to the rules for
  731. angle-bracket includes.
  732. In either case, if there are any tokens on the line after the file
  733. name, an error occurs and the directive is not processed. It is also an
  734. error if the result of expansion does not match either of the two
  735. expected forms.
  736. These rules are implementation-defined behavior according to the C
  737. standard. To minimize the risk of different compilers interpreting your
  738. computed includes differently, we recommend you use only a single
  739. object-like macro which expands to a string constant. This will also
  740. minimize confusion for people reading your program.
  741. 
  742. File: x86_64-linux-gnu-cpp.info, Node: Wrapper Headers, Next: System Headers, Prev: Computed Includes, Up: Header Files
  743. 2.7 Wrapper Headers
  744. ===================
  745. Sometimes it is necessary to adjust the contents of a system-provided
  746. header file without editing it directly. GCC's 'fixincludes' operation
  747. does this, for example. One way to do that would be to create a new
  748. header file with the same name and insert it in the search path before
  749. the original header. That works fine as long as you're willing to
  750. replace the old header entirely. But what if you want to refer to the
  751. old header from the new one?
  752. You cannot simply include the old header with '#include'. That will
  753. start from the beginning, and find your new header again. If your
  754. header is not protected from multiple inclusion (*note Once-Only
  755. Headers::), it will recurse infinitely and cause a fatal error.
  756. You could include the old header with an absolute pathname:
  757. #include "/usr/include/old-header.h"
  758. This works, but is not clean; should the system headers ever move, you
  759. would have to edit the new headers to match.
  760. There is no way to solve this problem within the C standard, but you
  761. can use the GNU extension '#include_next'. It means, "Include the
  762. _next_ file with this name". This directive works like '#include'
  763. except in searching for the specified file: it starts searching the list
  764. of header file directories _after_ the directory in which the current
  765. file was found.
  766. Suppose you specify '-I /usr/local/include', and the list of
  767. directories to search also includes '/usr/include'; and suppose both
  768. directories contain 'signal.h'. Ordinary '#include <signal.h>' finds
  769. the file under '/usr/local/include'. If that file contains
  770. '#include_next <signal.h>', it starts searching after that directory,
  771. and finds the file in '/usr/include'.
  772. '#include_next' does not distinguish between '<FILE>' and '"FILE"'
  773. inclusion, nor does it check that the file you specify has the same name
  774. as the current file. It simply looks for the file named, starting with
  775. the directory in the search path after the one where the current file
  776. was found.
  777. The use of '#include_next' can lead to great confusion. We recommend
  778. it be used only when there is no other alternative. In particular, it
  779. should not be used in the headers belonging to a specific program; it
  780. should be used only to make global corrections along the lines of
  781. 'fixincludes'.
  782. 
  783. File: x86_64-linux-gnu-cpp.info, Node: System Headers, Prev: Wrapper Headers, Up: Header Files
  784. 2.8 System Headers
  785. ==================
  786. The header files declaring interfaces to the operating system and
  787. runtime libraries often cannot be written in strictly conforming C.
  788. Therefore, GCC gives code found in "system headers" special treatment.
  789. All warnings, other than those generated by '#warning' (*note
  790. Diagnostics::), are suppressed while GCC is processing a system header.
  791. Macros defined in a system header are immune to a few warnings wherever
  792. they are expanded. This immunity is granted on an ad-hoc basis, when we
  793. find that a warning generates lots of false positives because of code in
  794. macros defined in system headers.
  795. Normally, only the headers found in specific directories are
  796. considered system headers. These directories are determined when GCC is
  797. compiled. There are, however, two ways to make normal headers into
  798. system headers:
  799. * Header files found in directories added to the search path with the
  800. '-isystem' and '-idirafter' command-line options are treated as
  801. system headers for the purposes of diagnostics.
  802. * There is also a directive, '#pragma GCC system_header', which tells
  803. GCC to consider the rest of the current include file a system
  804. header, no matter where it was found. Code that comes before the
  805. '#pragma' in the file is not affected. '#pragma GCC system_header'
  806. has no effect in the primary source file.
  807. On some targets, such as RS/6000 AIX, GCC implicitly surrounds all
  808. system headers with an 'extern "C"' block when compiling as C++.
  809. 
  810. File: x86_64-linux-gnu-cpp.info, Node: Macros, Next: Conditionals, Prev: Header Files, Up: Top
  811. 3 Macros
  812. ********
  813. A "macro" is a fragment of code which has been given a name. Whenever
  814. the name is used, it is replaced by the contents of the macro. There
  815. are two kinds of macros. They differ mostly in what they look like when
  816. they are used. "Object-like" macros resemble data objects when used,
  817. "function-like" macros resemble function calls.
  818. You may define any valid identifier as a macro, even if it is a C
  819. keyword. The preprocessor does not know anything about keywords. This
  820. can be useful if you wish to hide a keyword such as 'const' from an
  821. older compiler that does not understand it. However, the preprocessor
  822. operator 'defined' (*note Defined::) can never be defined as a macro,
  823. and C++'s named operators (*note C++ Named Operators::) cannot be macros
  824. when you are compiling C++.
  825. * Menu:
  826. * Object-like Macros::
  827. * Function-like Macros::
  828. * Macro Arguments::
  829. * Stringizing::
  830. * Concatenation::
  831. * Variadic Macros::
  832. * Predefined Macros::
  833. * Undefining and Redefining Macros::
  834. * Directives Within Macro Arguments::
  835. * Macro Pitfalls::
  836. 
  837. File: x86_64-linux-gnu-cpp.info, Node: Object-like Macros, Next: Function-like Macros, Up: Macros
  838. 3.1 Object-like Macros
  839. ======================
  840. An "object-like macro" is a simple identifier which will be replaced by
  841. a code fragment. It is called object-like because it looks like a data
  842. object in code that uses it. They are most commonly used to give
  843. symbolic names to numeric constants.
  844. You create macros with the '#define' directive. '#define' is
  845. followed by the name of the macro and then the token sequence it should
  846. be an abbreviation for, which is variously referred to as the macro's
  847. "body", "expansion" or "replacement list". For example,
  848. #define BUFFER_SIZE 1024
  849. defines a macro named 'BUFFER_SIZE' as an abbreviation for the token
  850. '1024'. If somewhere after this '#define' directive there comes a C
  851. statement of the form
  852. foo = (char *) malloc (BUFFER_SIZE);
  853. then the C preprocessor will recognize and "expand" the macro
  854. 'BUFFER_SIZE'. The C compiler will see the same tokens as it would if
  855. you had written
  856. foo = (char *) malloc (1024);
  857. By convention, macro names are written in uppercase. Programs are
  858. easier to read when it is possible to tell at a glance which names are
  859. macros.
  860. The macro's body ends at the end of the '#define' line. You may
  861. continue the definition onto multiple lines, if necessary, using
  862. backslash-newline. When the macro is expanded, however, it will all
  863. come out on one line. For example,
  864. #define NUMBERS 1, \
  865. 2, \
  866. 3
  867. int x[] = { NUMBERS };
  868. ==> int x[] = { 1, 2, 3 };
  869. The most common visible consequence of this is surprising line numbers
  870. in error messages.
  871. There is no restriction on what can go in a macro body provided it
  872. decomposes into valid preprocessing tokens. Parentheses need not
  873. balance, and the body need not resemble valid C code. (If it does not,
  874. you may get error messages from the C compiler when you use the macro.)
  875. The C preprocessor scans your program sequentially. Macro
  876. definitions take effect at the place you write them. Therefore, the
  877. following input to the C preprocessor
  878. foo = X;
  879. #define X 4
  880. bar = X;
  881. produces
  882. foo = X;
  883. bar = 4;
  884. When the preprocessor expands a macro name, the macro's expansion
  885. replaces the macro invocation, then the expansion is examined for more
  886. macros to expand. For example,
  887. #define TABLESIZE BUFSIZE
  888. #define BUFSIZE 1024
  889. TABLESIZE
  890. ==> BUFSIZE
  891. ==> 1024
  892. 'TABLESIZE' is expanded first to produce 'BUFSIZE', then that macro is
  893. expanded to produce the final result, '1024'.
  894. Notice that 'BUFSIZE' was not defined when 'TABLESIZE' was defined.
  895. The '#define' for 'TABLESIZE' uses exactly the expansion you specify--in
  896. this case, 'BUFSIZE'--and does not check to see whether it too contains
  897. macro names. Only when you _use_ 'TABLESIZE' is the result of its
  898. expansion scanned for more macro names.
  899. This makes a difference if you change the definition of 'BUFSIZE' at
  900. some point in the source file. 'TABLESIZE', defined as shown, will
  901. always expand using the definition of 'BUFSIZE' that is currently in
  902. effect:
  903. #define BUFSIZE 1020
  904. #define TABLESIZE BUFSIZE
  905. #undef BUFSIZE
  906. #define BUFSIZE 37
  907. Now 'TABLESIZE' expands (in two stages) to '37'.
  908. If the expansion of a macro contains its own name, either directly or
  909. via intermediate macros, it is not expanded again when the expansion is
  910. examined for more macros. This prevents infinite recursion. *Note
  911. Self-Referential Macros::, for the precise details.
  912. 
  913. File: x86_64-linux-gnu-cpp.info, Node: Function-like Macros, Next: Macro Arguments, Prev: Object-like Macros, Up: Macros
  914. 3.2 Function-like Macros
  915. ========================
  916. You can also define macros whose use looks like a function call. These
  917. are called "function-like macros". To define a function-like macro, you
  918. use the same '#define' directive, but you put a pair of parentheses
  919. immediately after the macro name. For example,
  920. #define lang_init() c_init()
  921. lang_init()
  922. ==> c_init()
  923. A function-like macro is only expanded if its name appears with a
  924. pair of parentheses after it. If you write just the name, it is left
  925. alone. This can be useful when you have a function and a macro of the
  926. same name, and you wish to use the function sometimes.
  927. extern void foo(void);
  928. #define foo() /* optimized inline version */
  929. ...
  930. foo();
  931. funcptr = foo;
  932. Here the call to 'foo()' will use the macro, but the function pointer
  933. will get the address of the real function. If the macro were to be
  934. expanded, it would cause a syntax error.
  935. If you put spaces between the macro name and the parentheses in the
  936. macro definition, that does not define a function-like macro, it defines
  937. an object-like macro whose expansion happens to begin with a pair of
  938. parentheses.
  939. #define lang_init () c_init()
  940. lang_init()
  941. ==> () c_init()()
  942. The first two pairs of parentheses in this expansion come from the
  943. macro. The third is the pair that was originally after the macro
  944. invocation. Since 'lang_init' is an object-like macro, it does not
  945. consume those parentheses.
  946. 
  947. File: x86_64-linux-gnu-cpp.info, Node: Macro Arguments, Next: Stringizing, Prev: Function-like Macros, Up: Macros
  948. 3.3 Macro Arguments
  949. ===================
  950. Function-like macros can take "arguments", just like true functions. To
  951. define a macro that uses arguments, you insert "parameters" between the
  952. pair of parentheses in the macro definition that make the macro
  953. function-like. The parameters must be valid C identifiers, separated by
  954. commas and optionally whitespace.
  955. To invoke a macro that takes arguments, you write the name of the
  956. macro followed by a list of "actual arguments" in parentheses, separated
  957. by commas. The invocation of the macro need not be restricted to a
  958. single logical line--it can cross as many lines in the source file as
  959. you wish. The number of arguments you give must match the number of
  960. parameters in the macro definition. When the macro is expanded, each
  961. use of a parameter in its body is replaced by the tokens of the
  962. corresponding argument. (You need not use all of the parameters in the
  963. macro body.)
  964. As an example, here is a macro that computes the minimum of two
  965. numeric values, as it is defined in many C programs, and some uses.
  966. #define min(X, Y) ((X) < (Y) ? (X) : (Y))
  967. x = min(a, b); ==> x = ((a) < (b) ? (a) : (b));
  968. y = min(1, 2); ==> y = ((1) < (2) ? (1) : (2));
  969. z = min(a + 28, *p); ==> z = ((a + 28) < (*p) ? (a + 28) : (*p));
  970. (In this small example you can already see several of the dangers of
  971. macro arguments. *Note Macro Pitfalls::, for detailed explanations.)
  972. Leading and trailing whitespace in each argument is dropped, and all
  973. whitespace between the tokens of an argument is reduced to a single
  974. space. Parentheses within each argument must balance; a comma within
  975. such parentheses does not end the argument. However, there is no
  976. requirement for square brackets or braces to balance, and they do not
  977. prevent a comma from separating arguments. Thus,
  978. macro (array[x = y, x + 1])
  979. passes two arguments to 'macro': 'array[x = y' and 'x + 1]'. If you
  980. want to supply 'array[x = y, x + 1]' as an argument, you can write it as
  981. 'array[(x = y, x + 1)]', which is equivalent C code.
  982. All arguments to a macro are completely macro-expanded before they
  983. are substituted into the macro body. After substitution, the complete
  984. text is scanned again for macros to expand, including the arguments.
  985. This rule may seem strange, but it is carefully designed so you need not
  986. worry about whether any function call is actually a macro invocation.
  987. You can run into trouble if you try to be too clever, though. *Note
  988. Argument Prescan::, for detailed discussion.
  989. For example, 'min (min (a, b), c)' is first expanded to
  990. min (((a) < (b) ? (a) : (b)), (c))
  991. and then to
  992. ((((a) < (b) ? (a) : (b))) < (c)
  993. ? (((a) < (b) ? (a) : (b)))
  994. : (c))
  995. (Line breaks shown here for clarity would not actually be generated.)
  996. You can leave macro arguments empty; this is not an error to the
  997. preprocessor (but many macros will then expand to invalid code). You
  998. cannot leave out arguments entirely; if a macro takes two arguments,
  999. there must be exactly one comma at the top level of its argument list.
  1000. Here are some silly examples using 'min':
  1001. min(, b) ==> (( ) < (b) ? ( ) : (b))
  1002. min(a, ) ==> ((a ) < ( ) ? (a ) : ( ))
  1003. min(,) ==> (( ) < ( ) ? ( ) : ( ))
  1004. min((,),) ==> (((,)) < ( ) ? ((,)) : ( ))
  1005. min() error-> macro "min" requires 2 arguments, but only 1 given
  1006. min(,,) error-> macro "min" passed 3 arguments, but takes just 2
  1007. Whitespace is not a preprocessing token, so if a macro 'foo' takes
  1008. one argument, 'foo ()' and 'foo ( )' both supply it an empty argument.
  1009. Previous GNU preprocessor implementations and documentation were
  1010. incorrect on this point, insisting that a function-like macro that takes
  1011. a single argument be passed a space if an empty argument was required.
  1012. Macro parameters appearing inside string literals are not replaced by
  1013. their corresponding actual arguments.
  1014. #define foo(x) x, "x"
  1015. foo(bar) ==> bar, "x"
  1016. 
  1017. File: x86_64-linux-gnu-cpp.info, Node: Stringizing, Next: Concatenation, Prev: Macro Arguments, Up: Macros
  1018. 3.4 Stringizing
  1019. ===============
  1020. Sometimes you may want to convert a macro argument into a string
  1021. constant. Parameters are not replaced inside string constants, but you
  1022. can use the '#' preprocessing operator instead. When a macro parameter
  1023. is used with a leading '#', the preprocessor replaces it with the
  1024. literal text of the actual argument, converted to a string constant.
  1025. Unlike normal parameter replacement, the argument is not macro-expanded
  1026. first. This is called "stringizing".
  1027. There is no way to combine an argument with surrounding text and
  1028. stringize it all together. Instead, you can write a series of adjacent
  1029. string constants and stringized arguments. The preprocessor replaces
  1030. the stringized arguments with string constants. The C compiler then
  1031. combines all the adjacent string constants into one long string.
  1032. Here is an example of a macro definition that uses stringizing:
  1033. #define WARN_IF(EXP) \
  1034. do { if (EXP) \
  1035. fprintf (stderr, "Warning: " #EXP "\n"); } \
  1036. while (0)
  1037. WARN_IF (x == 0);
  1038. ==> do { if (x == 0)
  1039. fprintf (stderr, "Warning: " "x == 0" "\n"); } while (0);
  1040. The argument for 'EXP' is substituted once, as-is, into the 'if'
  1041. statement, and once, stringized, into the argument to 'fprintf'. If 'x'
  1042. were a macro, it would be expanded in the 'if' statement, but not in the
  1043. string.
  1044. The 'do' and 'while (0)' are a kludge to make it possible to write
  1045. 'WARN_IF (ARG);', which the resemblance of 'WARN_IF' to a function would
  1046. make C programmers want to do; see *note Swallowing the Semicolon::.
  1047. Stringizing in C involves more than putting double-quote characters
  1048. around the fragment. The preprocessor backslash-escapes the quotes
  1049. surrounding embedded string constants, and all backslashes within string
  1050. and character constants, in order to get a valid C string constant with
  1051. the proper contents. Thus, stringizing 'p = "foo\n";' results in
  1052. "p = \"foo\\n\";". However, backslashes that are not inside string or
  1053. character constants are not duplicated: '\n' by itself stringizes to
  1054. "\n".
  1055. All leading and trailing whitespace in text being stringized is
  1056. ignored. Any sequence of whitespace in the middle of the text is
  1057. converted to a single space in the stringized result. Comments are
  1058. replaced by whitespace long before stringizing happens, so they never
  1059. appear in stringized text.
  1060. There is no way to convert a macro argument into a character
  1061. constant.
  1062. If you want to stringize the result of expansion of a macro argument,
  1063. you have to use two levels of macros.
  1064. #define xstr(s) str(s)
  1065. #define str(s) #s
  1066. #define foo 4
  1067. str (foo)
  1068. ==> "foo"
  1069. xstr (foo)
  1070. ==> xstr (4)
  1071. ==> str (4)
  1072. ==> "4"
  1073. 's' is stringized when it is used in 'str', so it is not
  1074. macro-expanded first. But 's' is an ordinary argument to 'xstr', so it
  1075. is completely macro-expanded before 'xstr' itself is expanded (*note
  1076. Argument Prescan::). Therefore, by the time 'str' gets to its argument,
  1077. it has already been macro-expanded.
  1078. 
  1079. File: x86_64-linux-gnu-cpp.info, Node: Concatenation, Next: Variadic Macros, Prev: Stringizing, Up: Macros
  1080. 3.5 Concatenation
  1081. =================
  1082. It is often useful to merge two tokens into one while expanding macros.
  1083. This is called "token pasting" or "token concatenation". The '##'
  1084. preprocessing operator performs token pasting. When a macro is
  1085. expanded, the two tokens on either side of each '##' operator are
  1086. combined into a single token, which then replaces the '##' and the two
  1087. original tokens in the macro expansion. Usually both will be
  1088. identifiers, or one will be an identifier and the other a preprocessing
  1089. number. When pasted, they make a longer identifier. This isn't the
  1090. only valid case. It is also possible to concatenate two numbers (or a
  1091. number and a name, such as '1.5' and 'e3') into a number. Also,
  1092. multi-character operators such as '+=' can be formed by token pasting.
  1093. However, two tokens that don't together form a valid token cannot be
  1094. pasted together. For example, you cannot concatenate 'x' with '+' in
  1095. either order. If you try, the preprocessor issues a warning and emits
  1096. the two tokens. Whether it puts white space between the tokens is
  1097. undefined. It is common to find unnecessary uses of '##' in complex
  1098. macros. If you get this warning, it is likely that you can simply
  1099. remove the '##'.
  1100. Both the tokens combined by '##' could come from the macro body, but
  1101. you could just as well write them as one token in the first place.
  1102. Token pasting is most useful when one or both of the tokens comes from a
  1103. macro argument. If either of the tokens next to an '##' is a parameter
  1104. name, it is replaced by its actual argument before '##' executes. As
  1105. with stringizing, the actual argument is not macro-expanded first. If
  1106. the argument is empty, that '##' has no effect.
  1107. Keep in mind that the C preprocessor converts comments to whitespace
  1108. before macros are even considered. Therefore, you cannot create a
  1109. comment by concatenating '/' and '*'. You can put as much whitespace
  1110. between '##' and its operands as you like, including comments, and you
  1111. can put comments in arguments that will be concatenated. However, it is
  1112. an error if '##' appears at either end of a macro body.
  1113. Consider a C program that interprets named commands. There probably
  1114. needs to be a table of commands, perhaps an array of structures declared
  1115. as follows:
  1116. struct command
  1117. {
  1118. char *name;
  1119. void (*function) (void);
  1120. };
  1121. struct command commands[] =
  1122. {
  1123. { "quit", quit_command },
  1124. { "help", help_command },
  1125. ...
  1126. };
  1127. It would be cleaner not to have to give each command name twice, once
  1128. in the string constant and once in the function name. A macro which
  1129. takes the name of a command as an argument can make this unnecessary.
  1130. The string constant can be created with stringizing, and the function
  1131. name by concatenating the argument with '_command'. Here is how it is
  1132. done:
  1133. #define COMMAND(NAME) { #NAME, NAME ## _command }
  1134. struct command commands[] =
  1135. {
  1136. COMMAND (quit),
  1137. COMMAND (help),
  1138. ...
  1139. };
  1140. 
  1141. File: x86_64-linux-gnu-cpp.info, Node: Variadic Macros, Next: Predefined Macros, Prev: Concatenation, Up: Macros
  1142. 3.6 Variadic Macros
  1143. ===================
  1144. A macro can be declared to accept a variable number of arguments much as
  1145. a function can. The syntax for defining the macro is similar to that of
  1146. a function. Here is an example:
  1147. #define eprintf(...) fprintf (stderr, __VA_ARGS__)
  1148. This kind of macro is called "variadic". When the macro is invoked,
  1149. all the tokens in its argument list after the last named argument (this
  1150. macro has none), including any commas, become the "variable argument".
  1151. This sequence of tokens replaces the identifier '__VA_ARGS__' in the
  1152. macro body wherever it appears. Thus, we have this expansion:
  1153. eprintf ("%s:%d: ", input_file, lineno)
  1154. ==> fprintf (stderr, "%s:%d: ", input_file, lineno)
  1155. The variable argument is completely macro-expanded before it is
  1156. inserted into the macro expansion, just like an ordinary argument. You
  1157. may use the '#' and '##' operators to stringize the variable argument or
  1158. to paste its leading or trailing token with another token. (But see
  1159. below for an important special case for '##'.)
  1160. If your macro is complicated, you may want a more descriptive name
  1161. for the variable argument than '__VA_ARGS__'. CPP permits this, as an
  1162. extension. You may write an argument name immediately before the '...';
  1163. that name is used for the variable argument. The 'eprintf' macro above
  1164. could be written
  1165. #define eprintf(args...) fprintf (stderr, args)
  1166. using this extension. You cannot use '__VA_ARGS__' and this extension
  1167. in the same macro.
  1168. You can have named arguments as well as variable arguments in a
  1169. variadic macro. We could define 'eprintf' like this, instead:
  1170. #define eprintf(format, ...) fprintf (stderr, format, __VA_ARGS__)
  1171. This formulation looks more descriptive, but historically it was less
  1172. flexible: you had to supply at least one argument after the format
  1173. string. In standard C, you could not omit the comma separating the
  1174. named argument from the variable arguments. (Note that this restriction
  1175. has been lifted in C++2a, and never existed in GNU C; see below.)
  1176. Furthermore, if you left the variable argument empty, you would have
  1177. gotten a syntax error, because there would have been an extra comma
  1178. after the format string.
  1179. eprintf("success!\n", );
  1180. ==> fprintf(stderr, "success!\n", );
  1181. This has been fixed in C++2a, and GNU CPP also has a pair of
  1182. extensions which deal with this problem.
  1183. First, in GNU CPP, and in C++ beginning in C++2a, you are allowed to
  1184. leave the variable argument out entirely:
  1185. eprintf ("success!\n")
  1186. ==> fprintf(stderr, "success!\n", );
  1187. Second, C++2a introduces the '__VA_OPT__' function macro. This macro
  1188. may only appear in the definition of a variadic macro. If the variable
  1189. argument has any tokens, then a '__VA_OPT__' invocation expands to its
  1190. argument; but if the variable argument does not have any tokens, the
  1191. '__VA_OPT__' expands to nothing:
  1192. #define eprintf(format, ...) \
  1193. fprintf (stderr, format __VA_OPT__(,) __VA_ARGS__)
  1194. '__VA_OPT__' is also available in GNU C and GNU C++.
  1195. Historically, GNU CPP has also had another extension to handle the
  1196. trailing comma: the '##' token paste operator has a special meaning when
  1197. placed between a comma and a variable argument. Despite the
  1198. introduction of '__VA_OPT__', this extension remains supported in GNU
  1199. CPP, for backward compatibility. If you write
  1200. #define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
  1201. and the variable argument is left out when the 'eprintf' macro is used,
  1202. then the comma before the '##' will be deleted. This does _not_ happen
  1203. if you pass an empty argument, nor does it happen if the token preceding
  1204. '##' is anything other than a comma.
  1205. eprintf ("success!\n")
  1206. ==> fprintf(stderr, "success!\n");
  1207. The above explanation is ambiguous about the case where the only macro
  1208. parameter is a variable arguments parameter, as it is meaningless to try
  1209. to distinguish whether no argument at all is an empty argument or a
  1210. missing argument. CPP retains the comma when conforming to a specific C
  1211. standard. Otherwise the comma is dropped as an extension to the
  1212. standard.
  1213. The C standard mandates that the only place the identifier
  1214. '__VA_ARGS__' can appear is in the replacement list of a variadic macro.
  1215. It may not be used as a macro name, macro argument name, or within a
  1216. different type of macro. It may also be forbidden in open text; the
  1217. standard is ambiguous. We recommend you avoid using it except for its
  1218. defined purpose.
  1219. Likewise, C++ forbids '__VA_OPT__' anywhere outside the replacement
  1220. list of a variadic macro.
  1221. Variadic macros became a standard part of the C language with C99.
  1222. GNU CPP previously supported them with a named variable argument
  1223. ('args...', not '...' and '__VA_ARGS__'), which is still supported for
  1224. backward compatibility.
  1225. 
  1226. File: x86_64-linux-gnu-cpp.info, Node: Predefined Macros, Next: Undefining and Redefining Macros, Prev: Variadic Macros, Up: Macros
  1227. 3.7 Predefined Macros
  1228. =====================
  1229. Several object-like macros are predefined; you use them without
  1230. supplying their definitions. They fall into three classes: standard,
  1231. common, and system-specific.
  1232. In C++, there is a fourth category, the named operators. They act
  1233. like predefined macros, but you cannot undefine them.
  1234. * Menu:
  1235. * Standard Predefined Macros::
  1236. * Common Predefined Macros::
  1237. * System-specific Predefined Macros::
  1238. * C++ Named Operators::
  1239. 
  1240. File: x86_64-linux-gnu-cpp.info, Node: Standard Predefined Macros, Next: Common Predefined Macros, Up: Predefined Macros
  1241. 3.7.1 Standard Predefined Macros
  1242. --------------------------------
  1243. The standard predefined macros are specified by the relevant language
  1244. standards, so they are available with all compilers that implement those
  1245. standards. Older compilers may not provide all of them. Their names
  1246. all start with double underscores.
  1247. '__FILE__'
  1248. This macro expands to the name of the current input file, in the
  1249. form of a C string constant. This is the path by which the
  1250. preprocessor opened the file, not the short name specified in
  1251. '#include' or as the input file name argument. For example,
  1252. '"/usr/local/include/myheader.h"' is a possible expansion of this
  1253. macro.
  1254. '__LINE__'
  1255. This macro expands to the current input line number, in the form of
  1256. a decimal integer constant. While we call it a predefined macro,
  1257. it's a pretty strange macro, since its "definition" changes with
  1258. each new line of source code.
  1259. '__FILE__' and '__LINE__' are useful in generating an error message
  1260. to report an inconsistency detected by the program; the message can
  1261. state the source line at which the inconsistency was detected. For
  1262. example,
  1263. fprintf (stderr, "Internal error: "
  1264. "negative string length "
  1265. "%d at %s, line %d.",
  1266. length, __FILE__, __LINE__);
  1267. An '#include' directive changes the expansions of '__FILE__' and
  1268. '__LINE__' to correspond to the included file. At the end of that file,
  1269. when processing resumes on the input file that contained the '#include'
  1270. directive, the expansions of '__FILE__' and '__LINE__' revert to the
  1271. values they had before the '#include' (but '__LINE__' is then
  1272. incremented by one as processing moves to the line after the
  1273. '#include').
  1274. A '#line' directive changes '__LINE__', and may change '__FILE__' as
  1275. well. *Note Line Control::.
  1276. C99 introduced '__func__', and GCC has provided '__FUNCTION__' for a
  1277. long time. Both of these are strings containing the name of the current
  1278. function (there are slight semantic differences; see the GCC manual).
  1279. Neither of them is a macro; the preprocessor does not know the name of
  1280. the current function. They tend to be useful in conjunction with
  1281. '__FILE__' and '__LINE__', though.
  1282. '__DATE__'
  1283. This macro expands to a string constant that describes the date on
  1284. which the preprocessor is being run. The string constant contains
  1285. eleven characters and looks like '"Feb 12 1996"'. If the day of
  1286. the month is less than 10, it is padded with a space on the left.
  1287. If GCC cannot determine the current date, it will emit a warning
  1288. message (once per compilation) and '__DATE__' will expand to
  1289. '"??? ?? ????"'.
  1290. '__TIME__'
  1291. This macro expands to a string constant that describes the time at
  1292. which the preprocessor is being run. The string constant contains
  1293. eight characters and looks like '"23:59:01"'.
  1294. If GCC cannot determine the current time, it will emit a warning
  1295. message (once per compilation) and '__TIME__' will expand to
  1296. '"??:??:??"'.
  1297. '__STDC__'
  1298. In normal operation, this macro expands to the constant 1, to
  1299. signify that this compiler conforms to ISO Standard C. If GNU CPP
  1300. is used with a compiler other than GCC, this is not necessarily
  1301. true; however, the preprocessor always conforms to the standard
  1302. unless the '-traditional-cpp' option is used.
  1303. This macro is not defined if the '-traditional-cpp' option is used.
  1304. On some hosts, the system compiler uses a different convention,
  1305. where '__STDC__' is normally 0, but is 1 if the user specifies
  1306. strict conformance to the C Standard. CPP follows the host
  1307. convention when processing system header files, but when processing
  1308. user files '__STDC__' is always 1. This has been reported to cause
  1309. problems; for instance, some versions of Solaris provide X Windows
  1310. headers that expect '__STDC__' to be either undefined or 1. *Note
  1311. Invocation::.
  1312. '__STDC_VERSION__'
  1313. This macro expands to the C Standard's version number, a long
  1314. integer constant of the form 'YYYYMML' where YYYY and MM are the
  1315. year and month of the Standard version. This signifies which
  1316. version of the C Standard the compiler conforms to. Like
  1317. '__STDC__', this is not necessarily accurate for the entire
  1318. implementation, unless GNU CPP is being used with GCC.
  1319. The value '199409L' signifies the 1989 C standard as amended in
  1320. 1994, which is the current default; the value '199901L' signifies
  1321. the 1999 revision of the C standard; the value '201112L' signifies
  1322. the 2011 revision of the C standard; the value '201710L' signifies
  1323. the 2017 revision of the C standard (which is otherwise identical
  1324. to the 2011 version apart from correction of defects). An
  1325. unspecified value larger than '201710L' is used for the
  1326. experimental '-std=c2x' and '-std=gnu2x' modes.
  1327. This macro is not defined if the '-traditional-cpp' option is used,
  1328. nor when compiling C++ or Objective-C.
  1329. '__STDC_HOSTED__'
  1330. This macro is defined, with value 1, if the compiler's target is a
  1331. "hosted environment". A hosted environment has the complete
  1332. facilities of the standard C library available.
  1333. '__cplusplus'
  1334. This macro is defined when the C++ compiler is in use. You can use
  1335. '__cplusplus' to test whether a header is compiled by a C compiler
  1336. or a C++ compiler. This macro is similar to '__STDC_VERSION__', in
  1337. that it expands to a version number. Depending on the language
  1338. standard selected, the value of the macro is '199711L' for the 1998
  1339. C++ standard, '201103L' for the 2011 C++ standard, '201402L' for
  1340. the 2014 C++ standard, '201703L' for the 2017 C++ standard, or an
  1341. unspecified value strictly larger than '201703L' for the
  1342. experimental languages enabled by '-std=c++2a' and '-std=gnu++2a'.
  1343. '__OBJC__'
  1344. This macro is defined, with value 1, when the Objective-C compiler
  1345. is in use. You can use '__OBJC__' to test whether a header is
  1346. compiled by a C compiler or an Objective-C compiler.
  1347. '__ASSEMBLER__'
  1348. This macro is defined with value 1 when preprocessing assembly
  1349. language.
  1350. 
  1351. File: x86_64-linux-gnu-cpp.info, Node: Common Predefined Macros, Next: System-specific Predefined Macros, Prev: Standard Predefined Macros, Up: Predefined Macros
  1352. 3.7.2 Common Predefined Macros
  1353. ------------------------------
  1354. The common predefined macros are GNU C extensions. They are available
  1355. with the same meanings regardless of the machine or operating system on
  1356. which you are using GNU C or GNU Fortran. Their names all start with
  1357. double underscores.
  1358. '__COUNTER__'
  1359. This macro expands to sequential integral values starting from 0.
  1360. In conjunction with the '##' operator, this provides a convenient
  1361. means to generate unique identifiers. Care must be taken to ensure
  1362. that '__COUNTER__' is not expanded prior to inclusion of
  1363. precompiled headers which use it. Otherwise, the precompiled
  1364. headers will not be used.
  1365. '__GFORTRAN__'
  1366. The GNU Fortran compiler defines this.
  1367. '__GNUC__'
  1368. '__GNUC_MINOR__'
  1369. '__GNUC_PATCHLEVEL__'
  1370. These macros are defined by all GNU compilers that use the C
  1371. preprocessor: C, C++, Objective-C and Fortran. Their values are
  1372. the major version, minor version, and patch level of the compiler,
  1373. as integer constants. For example, GCC version X.Y.Z defines
  1374. '__GNUC__' to X, '__GNUC_MINOR__' to Y, and '__GNUC_PATCHLEVEL__'
  1375. to Z. These macros are also defined if you invoke the preprocessor
  1376. directly.
  1377. If all you need to know is whether or not your program is being
  1378. compiled by GCC, or a non-GCC compiler that claims to accept the
  1379. GNU C dialects, you can simply test '__GNUC__'. If you need to
  1380. write code which depends on a specific version, you must be more
  1381. careful. Each time the minor version is increased, the patch level
  1382. is reset to zero; each time the major version is increased, the
  1383. minor version and patch level are reset. If you wish to use the
  1384. predefined macros directly in the conditional, you will need to
  1385. write it like this:
  1386. /* Test for GCC > 3.2.0 */
  1387. #if __GNUC__ > 3 || \
  1388. (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
  1389. (__GNUC_MINOR__ == 2 && \
  1390. __GNUC_PATCHLEVEL__ > 0))
  1391. Another approach is to use the predefined macros to calculate a
  1392. single number, then compare that against a threshold:
  1393. #define GCC_VERSION (__GNUC__ * 10000 \
  1394. + __GNUC_MINOR__ * 100 \
  1395. + __GNUC_PATCHLEVEL__)
  1396. ...
  1397. /* Test for GCC > 3.2.0 */
  1398. #if GCC_VERSION > 30200
  1399. Many people find this form easier to understand.
  1400. '__GNUG__'
  1401. The GNU C++ compiler defines this. Testing it is equivalent to
  1402. testing '(__GNUC__ && __cplusplus)'.
  1403. '__STRICT_ANSI__'
  1404. GCC defines this macro if and only if the '-ansi' switch, or a
  1405. '-std' switch specifying strict conformance to some version of ISO
  1406. C or ISO C++, was specified when GCC was invoked. It is defined to
  1407. '1'. This macro exists primarily to direct GNU libc's header files
  1408. to use only definitions found in standard C.
  1409. '__BASE_FILE__'
  1410. This macro expands to the name of the main input file, in the form
  1411. of a C string constant. This is the source file that was specified
  1412. on the command line of the preprocessor or C compiler.
  1413. '__INCLUDE_LEVEL__'
  1414. This macro expands to a decimal integer constant that represents
  1415. the depth of nesting in include files. The value of this macro is
  1416. incremented on every '#include' directive and decremented at the
  1417. end of every included file. It starts out at 0, its value within
  1418. the base file specified on the command line.
  1419. '__ELF__'
  1420. This macro is defined if the target uses the ELF object format.
  1421. '__VERSION__'
  1422. This macro expands to a string constant which describes the version
  1423. of the compiler in use. You should not rely on its contents having
  1424. any particular form, but it can be counted on to contain at least
  1425. the release number.
  1426. '__OPTIMIZE__'
  1427. '__OPTIMIZE_SIZE__'
  1428. '__NO_INLINE__'
  1429. These macros describe the compilation mode. '__OPTIMIZE__' is
  1430. defined in all optimizing compilations. '__OPTIMIZE_SIZE__' is
  1431. defined if the compiler is optimizing for size, not speed.
  1432. '__NO_INLINE__' is defined if no functions will be inlined into
  1433. their callers (when not optimizing, or when inlining has been
  1434. specifically disabled by '-fno-inline').
  1435. These macros cause certain GNU header files to provide optimized
  1436. definitions, using macros or inline functions, of system library
  1437. functions. You should not use these macros in any way unless you
  1438. make sure that programs will execute with the same effect whether
  1439. or not they are defined. If they are defined, their value is 1.
  1440. '__GNUC_GNU_INLINE__'
  1441. GCC defines this macro if functions declared 'inline' will be
  1442. handled in GCC's traditional gnu90 mode. Object files will contain
  1443. externally visible definitions of all functions declared 'inline'
  1444. without 'extern' or 'static'. They will not contain any
  1445. definitions of any functions declared 'extern inline'.
  1446. '__GNUC_STDC_INLINE__'
  1447. GCC defines this macro if functions declared 'inline' will be
  1448. handled according to the ISO C99 or later standards. Object files
  1449. will contain externally visible definitions of all functions
  1450. declared 'extern inline'. They will not contain definitions of any
  1451. functions declared 'inline' without 'extern'.
  1452. If this macro is defined, GCC supports the 'gnu_inline' function
  1453. attribute as a way to always get the gnu90 behavior.
  1454. '__CHAR_UNSIGNED__'
  1455. GCC defines this macro if and only if the data type 'char' is
  1456. unsigned on the target machine. It exists to cause the standard
  1457. header file 'limits.h' to work correctly. You should not use this
  1458. macro yourself; instead, refer to the standard macros defined in
  1459. 'limits.h'.
  1460. '__WCHAR_UNSIGNED__'
  1461. Like '__CHAR_UNSIGNED__', this macro is defined if and only if the
  1462. data type 'wchar_t' is unsigned and the front-end is in C++ mode.
  1463. '__REGISTER_PREFIX__'
  1464. This macro expands to a single token (not a string constant) which
  1465. is the prefix applied to CPU register names in assembly language
  1466. for this target. You can use it to write assembly that is usable
  1467. in multiple environments. For example, in the 'm68k-aout'
  1468. environment it expands to nothing, but in the 'm68k-coff'
  1469. environment it expands to a single '%'.
  1470. '__USER_LABEL_PREFIX__'
  1471. This macro expands to a single token which is the prefix applied to
  1472. user labels (symbols visible to C code) in assembly. For example,
  1473. in the 'm68k-aout' environment it expands to an '_', but in the
  1474. 'm68k-coff' environment it expands to nothing.
  1475. This macro will have the correct definition even if
  1476. '-f(no-)underscores' is in use, but it will not be correct if
  1477. target-specific options that adjust this prefix are used (e.g. the
  1478. OSF/rose '-mno-underscores' option).
  1479. '__SIZE_TYPE__'
  1480. '__PTRDIFF_TYPE__'
  1481. '__WCHAR_TYPE__'
  1482. '__WINT_TYPE__'
  1483. '__INTMAX_TYPE__'
  1484. '__UINTMAX_TYPE__'
  1485. '__SIG_ATOMIC_TYPE__'
  1486. '__INT8_TYPE__'
  1487. '__INT16_TYPE__'
  1488. '__INT32_TYPE__'
  1489. '__INT64_TYPE__'
  1490. '__UINT8_TYPE__'
  1491. '__UINT16_TYPE__'
  1492. '__UINT32_TYPE__'
  1493. '__UINT64_TYPE__'
  1494. '__INT_LEAST8_TYPE__'
  1495. '__INT_LEAST16_TYPE__'
  1496. '__INT_LEAST32_TYPE__'
  1497. '__INT_LEAST64_TYPE__'
  1498. '__UINT_LEAST8_TYPE__'
  1499. '__UINT_LEAST16_TYPE__'
  1500. '__UINT_LEAST32_TYPE__'
  1501. '__UINT_LEAST64_TYPE__'
  1502. '__INT_FAST8_TYPE__'
  1503. '__INT_FAST16_TYPE__'
  1504. '__INT_FAST32_TYPE__'
  1505. '__INT_FAST64_TYPE__'
  1506. '__UINT_FAST8_TYPE__'
  1507. '__UINT_FAST16_TYPE__'
  1508. '__UINT_FAST32_TYPE__'
  1509. '__UINT_FAST64_TYPE__'
  1510. '__INTPTR_TYPE__'
  1511. '__UINTPTR_TYPE__'
  1512. These macros are defined to the correct underlying types for the
  1513. 'size_t', 'ptrdiff_t', 'wchar_t', 'wint_t', 'intmax_t',
  1514. 'uintmax_t', 'sig_atomic_t', 'int8_t', 'int16_t', 'int32_t',
  1515. 'int64_t', 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
  1516. 'int_least8_t', 'int_least16_t', 'int_least32_t', 'int_least64_t',
  1517. 'uint_least8_t', 'uint_least16_t', 'uint_least32_t',
  1518. 'uint_least64_t', 'int_fast8_t', 'int_fast16_t', 'int_fast32_t',
  1519. 'int_fast64_t', 'uint_fast8_t', 'uint_fast16_t', 'uint_fast32_t',
  1520. 'uint_fast64_t', 'intptr_t', and 'uintptr_t' typedefs,
  1521. respectively. They exist to make the standard header files
  1522. 'stddef.h', 'stdint.h', and 'wchar.h' work correctly. You should
  1523. not use these macros directly; instead, include the appropriate
  1524. headers and use the typedefs. Some of these macros may not be
  1525. defined on particular systems if GCC does not provide a 'stdint.h'
  1526. header on those systems.
  1527. '__CHAR_BIT__'
  1528. Defined to the number of bits used in the representation of the
  1529. 'char' data type. It exists to make the standard header given
  1530. numerical limits work correctly. You should not use this macro
  1531. directly; instead, include the appropriate headers.
  1532. '__SCHAR_MAX__'
  1533. '__WCHAR_MAX__'
  1534. '__SHRT_MAX__'
  1535. '__INT_MAX__'
  1536. '__LONG_MAX__'
  1537. '__LONG_LONG_MAX__'
  1538. '__WINT_MAX__'
  1539. '__SIZE_MAX__'
  1540. '__PTRDIFF_MAX__'
  1541. '__INTMAX_MAX__'
  1542. '__UINTMAX_MAX__'
  1543. '__SIG_ATOMIC_MAX__'
  1544. '__INT8_MAX__'
  1545. '__INT16_MAX__'
  1546. '__INT32_MAX__'
  1547. '__INT64_MAX__'
  1548. '__UINT8_MAX__'
  1549. '__UINT16_MAX__'
  1550. '__UINT32_MAX__'
  1551. '__UINT64_MAX__'
  1552. '__INT_LEAST8_MAX__'
  1553. '__INT_LEAST16_MAX__'
  1554. '__INT_LEAST32_MAX__'
  1555. '__INT_LEAST64_MAX__'
  1556. '__UINT_LEAST8_MAX__'
  1557. '__UINT_LEAST16_MAX__'
  1558. '__UINT_LEAST32_MAX__'
  1559. '__UINT_LEAST64_MAX__'
  1560. '__INT_FAST8_MAX__'
  1561. '__INT_FAST16_MAX__'
  1562. '__INT_FAST32_MAX__'
  1563. '__INT_FAST64_MAX__'
  1564. '__UINT_FAST8_MAX__'
  1565. '__UINT_FAST16_MAX__'
  1566. '__UINT_FAST32_MAX__'
  1567. '__UINT_FAST64_MAX__'
  1568. '__INTPTR_MAX__'
  1569. '__UINTPTR_MAX__'
  1570. '__WCHAR_MIN__'
  1571. '__WINT_MIN__'
  1572. '__SIG_ATOMIC_MIN__'
  1573. Defined to the maximum value of the 'signed char', 'wchar_t',
  1574. 'signed short', 'signed int', 'signed long', 'signed long long',
  1575. 'wint_t', 'size_t', 'ptrdiff_t', 'intmax_t', 'uintmax_t',
  1576. 'sig_atomic_t', 'int8_t', 'int16_t', 'int32_t', 'int64_t',
  1577. 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int_least8_t',
  1578. 'int_least16_t', 'int_least32_t', 'int_least64_t', 'uint_least8_t',
  1579. 'uint_least16_t', 'uint_least32_t', 'uint_least64_t',
  1580. 'int_fast8_t', 'int_fast16_t', 'int_fast32_t', 'int_fast64_t',
  1581. 'uint_fast8_t', 'uint_fast16_t', 'uint_fast32_t', 'uint_fast64_t',
  1582. 'intptr_t', and 'uintptr_t' types and to the minimum value of the
  1583. 'wchar_t', 'wint_t', and 'sig_atomic_t' types respectively. They
  1584. exist to make the standard header given numerical limits work
  1585. correctly. You should not use these macros directly; instead,
  1586. include the appropriate headers. Some of these macros may not be
  1587. defined on particular systems if GCC does not provide a 'stdint.h'
  1588. header on those systems.
  1589. '__INT8_C'
  1590. '__INT16_C'
  1591. '__INT32_C'
  1592. '__INT64_C'
  1593. '__UINT8_C'
  1594. '__UINT16_C'
  1595. '__UINT32_C'
  1596. '__UINT64_C'
  1597. '__INTMAX_C'
  1598. '__UINTMAX_C'
  1599. Defined to implementations of the standard 'stdint.h' macros with
  1600. the same names without the leading '__'. They exist the make the
  1601. implementation of that header work correctly. You should not use
  1602. these macros directly; instead, include the appropriate headers.
  1603. Some of these macros may not be defined on particular systems if
  1604. GCC does not provide a 'stdint.h' header on those systems.
  1605. '__SCHAR_WIDTH__'
  1606. '__SHRT_WIDTH__'
  1607. '__INT_WIDTH__'
  1608. '__LONG_WIDTH__'
  1609. '__LONG_LONG_WIDTH__'
  1610. '__PTRDIFF_WIDTH__'
  1611. '__SIG_ATOMIC_WIDTH__'
  1612. '__SIZE_WIDTH__'
  1613. '__WCHAR_WIDTH__'
  1614. '__WINT_WIDTH__'
  1615. '__INT_LEAST8_WIDTH__'
  1616. '__INT_LEAST16_WIDTH__'
  1617. '__INT_LEAST32_WIDTH__'
  1618. '__INT_LEAST64_WIDTH__'
  1619. '__INT_FAST8_WIDTH__'
  1620. '__INT_FAST16_WIDTH__'
  1621. '__INT_FAST32_WIDTH__'
  1622. '__INT_FAST64_WIDTH__'
  1623. '__INTPTR_WIDTH__'
  1624. '__INTMAX_WIDTH__'
  1625. Defined to the bit widths of the corresponding types. They exist
  1626. to make the implementations of 'limits.h' and 'stdint.h' behave
  1627. correctly. You should not use these macros directly; instead,
  1628. include the appropriate headers. Some of these macros may not be
  1629. defined on particular systems if GCC does not provide a 'stdint.h'
  1630. header on those systems.
  1631. '__SIZEOF_INT__'
  1632. '__SIZEOF_LONG__'
  1633. '__SIZEOF_LONG_LONG__'
  1634. '__SIZEOF_SHORT__'
  1635. '__SIZEOF_POINTER__'
  1636. '__SIZEOF_FLOAT__'
  1637. '__SIZEOF_DOUBLE__'
  1638. '__SIZEOF_LONG_DOUBLE__'
  1639. '__SIZEOF_SIZE_T__'
  1640. '__SIZEOF_WCHAR_T__'
  1641. '__SIZEOF_WINT_T__'
  1642. '__SIZEOF_PTRDIFF_T__'
  1643. Defined to the number of bytes of the C standard data types: 'int',
  1644. 'long', 'long long', 'short', 'void *', 'float', 'double', 'long
  1645. double', 'size_t', 'wchar_t', 'wint_t' and 'ptrdiff_t'.
  1646. '__BYTE_ORDER__'
  1647. '__ORDER_LITTLE_ENDIAN__'
  1648. '__ORDER_BIG_ENDIAN__'
  1649. '__ORDER_PDP_ENDIAN__'
  1650. '__BYTE_ORDER__' is defined to one of the values
  1651. '__ORDER_LITTLE_ENDIAN__', '__ORDER_BIG_ENDIAN__', or
  1652. '__ORDER_PDP_ENDIAN__' to reflect the layout of multi-byte and
  1653. multi-word quantities in memory. If '__BYTE_ORDER__' is equal to
  1654. '__ORDER_LITTLE_ENDIAN__' or '__ORDER_BIG_ENDIAN__', then
  1655. multi-byte and multi-word quantities are laid out identically: the
  1656. byte (word) at the lowest address is the least significant or most
  1657. significant byte (word) of the quantity, respectively. If
  1658. '__BYTE_ORDER__' is equal to '__ORDER_PDP_ENDIAN__', then bytes in
  1659. 16-bit words are laid out in a little-endian fashion, whereas the
  1660. 16-bit subwords of a 32-bit quantity are laid out in big-endian
  1661. fashion.
  1662. You should use these macros for testing like this:
  1663. /* Test for a little-endian machine */
  1664. #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
  1665. '__FLOAT_WORD_ORDER__'
  1666. '__FLOAT_WORD_ORDER__' is defined to one of the values
  1667. '__ORDER_LITTLE_ENDIAN__' or '__ORDER_BIG_ENDIAN__' to reflect the
  1668. layout of the words of multi-word floating-point quantities.
  1669. '__DEPRECATED'
  1670. This macro is defined, with value 1, when compiling a C++ source
  1671. file with warnings about deprecated constructs enabled. These
  1672. warnings are enabled by default, but can be disabled with
  1673. '-Wno-deprecated'.
  1674. '__EXCEPTIONS'
  1675. This macro is defined, with value 1, when compiling a C++ source
  1676. file with exceptions enabled. If '-fno-exceptions' is used when
  1677. compiling the file, then this macro is not defined.
  1678. '__GXX_RTTI'
  1679. This macro is defined, with value 1, when compiling a C++ source
  1680. file with runtime type identification enabled. If '-fno-rtti' is
  1681. used when compiling the file, then this macro is not defined.
  1682. '__USING_SJLJ_EXCEPTIONS__'
  1683. This macro is defined, with value 1, if the compiler uses the old
  1684. mechanism based on 'setjmp' and 'longjmp' for exception handling.
  1685. '__GXX_EXPERIMENTAL_CXX0X__'
  1686. This macro is defined when compiling a C++ source file with the
  1687. option '-std=c++0x' or '-std=gnu++0x'. It indicates that some
  1688. features likely to be included in C++0x are available. Note that
  1689. these features are experimental, and may change or be removed in
  1690. future versions of GCC.
  1691. '__GXX_WEAK__'
  1692. This macro is defined when compiling a C++ source file. It has the
  1693. value 1 if the compiler will use weak symbols, COMDAT sections, or
  1694. other similar techniques to collapse symbols with "vague linkage"
  1695. that are defined in multiple translation units. If the compiler
  1696. will not collapse such symbols, this macro is defined with value 0.
  1697. In general, user code should not need to make use of this macro;
  1698. the purpose of this macro is to ease implementation of the C++
  1699. runtime library provided with G++.
  1700. '__NEXT_RUNTIME__'
  1701. This macro is defined, with value 1, if (and only if) the NeXT
  1702. runtime (as in '-fnext-runtime') is in use for Objective-C. If the
  1703. GNU runtime is used, this macro is not defined, so that you can use
  1704. this macro to determine which runtime (NeXT or GNU) is being used.
  1705. '__LP64__'
  1706. '_LP64'
  1707. These macros are defined, with value 1, if (and only if) the
  1708. compilation is for a target where 'long int' and pointer both use
  1709. 64-bits and 'int' uses 32-bit.
  1710. '__SSP__'
  1711. This macro is defined, with value 1, when '-fstack-protector' is in
  1712. use.
  1713. '__SSP_ALL__'
  1714. This macro is defined, with value 2, when '-fstack-protector-all'
  1715. is in use.
  1716. '__SSP_STRONG__'
  1717. This macro is defined, with value 3, when
  1718. '-fstack-protector-strong' is in use.
  1719. '__SSP_EXPLICIT__'
  1720. This macro is defined, with value 4, when
  1721. '-fstack-protector-explicit' is in use.
  1722. '__SANITIZE_ADDRESS__'
  1723. This macro is defined, with value 1, when '-fsanitize=address' or
  1724. '-fsanitize=kernel-address' are in use.
  1725. '__SANITIZE_THREAD__'
  1726. This macro is defined, with value 1, when '-fsanitize=thread' is in
  1727. use.
  1728. '__TIMESTAMP__'
  1729. This macro expands to a string constant that describes the date and
  1730. time of the last modification of the current source file. The
  1731. string constant contains abbreviated day of the week, month, day of
  1732. the month, time in hh:mm:ss form, year and looks like
  1733. '"Sun Sep 16 01:03:52 1973"'. If the day of the month is less than
  1734. 10, it is padded with a space on the left.
  1735. If GCC cannot determine the current date, it will emit a warning
  1736. message (once per compilation) and '__TIMESTAMP__' will expand to
  1737. '"??? ??? ?? ??:??:?? ????"'.
  1738. '__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1'
  1739. '__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2'
  1740. '__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4'
  1741. '__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8'
  1742. '__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16'
  1743. These macros are defined when the target processor supports atomic
  1744. compare and swap operations on operands 1, 2, 4, 8 or 16 bytes in
  1745. length, respectively.
  1746. '__HAVE_SPECULATION_SAFE_VALUE'
  1747. This macro is defined with the value 1 to show that this version of
  1748. GCC supports '__builtin_speculation_safe_value'.
  1749. '__GCC_HAVE_DWARF2_CFI_ASM'
  1750. This macro is defined when the compiler is emitting DWARF CFI
  1751. directives to the assembler. When this is defined, it is possible
  1752. to emit those same directives in inline assembly.
  1753. '__FP_FAST_FMA'
  1754. '__FP_FAST_FMAF'
  1755. '__FP_FAST_FMAL'
  1756. These macros are defined with value 1 if the backend supports the
  1757. 'fma', 'fmaf', and 'fmal' builtin functions, so that the include
  1758. file 'math.h' can define the macros 'FP_FAST_FMA', 'FP_FAST_FMAF',
  1759. and 'FP_FAST_FMAL' for compatibility with the 1999 C standard.
  1760. '__FP_FAST_FMAF16'
  1761. '__FP_FAST_FMAF32'
  1762. '__FP_FAST_FMAF64'
  1763. '__FP_FAST_FMAF128'
  1764. '__FP_FAST_FMAF32X'
  1765. '__FP_FAST_FMAF64X'
  1766. '__FP_FAST_FMAF128X'
  1767. These macros are defined with the value 1 if the backend supports
  1768. the 'fma' functions using the additional '_FloatN' and '_FloatNx'
  1769. types that are defined in ISO/IEC TS 18661-3:2015. The include
  1770. file 'math.h' can define the 'FP_FAST_FMAFN' and 'FP_FAST_FMAFNx'
  1771. macros if the user defined '__STDC_WANT_IEC_60559_TYPES_EXT__'
  1772. before including 'math.h'.
  1773. '__GCC_IEC_559'
  1774. This macro is defined to indicate the intended level of support for
  1775. IEEE 754 (IEC 60559) floating-point arithmetic. It expands to a
  1776. nonnegative integer value. If 0, it indicates that the combination
  1777. of the compiler configuration and the command-line options is not
  1778. intended to support IEEE 754 arithmetic for 'float' and 'double' as
  1779. defined in C99 and C11 Annex F (for example, that the standard
  1780. rounding modes and exceptions are not supported, or that
  1781. optimizations are enabled that conflict with IEEE 754 semantics).
  1782. If 1, it indicates that IEEE 754 arithmetic is intended to be
  1783. supported; this does not mean that all relevant language features
  1784. are supported by GCC. If 2 or more, it additionally indicates
  1785. support for IEEE 754-2008 (in particular, that the binary encodings
  1786. for quiet and signaling NaNs are as specified in IEEE 754-2008).
  1787. This macro does not indicate the default state of command-line
  1788. options that control optimizations that C99 and C11 permit to be
  1789. controlled by standard pragmas, where those standards do not
  1790. require a particular default state. It does not indicate whether
  1791. optimizations respect signaling NaN semantics (the macro for that
  1792. is '__SUPPORT_SNAN__'). It does not indicate support for decimal
  1793. floating point or the IEEE 754 binary16 and binary128 types.
  1794. '__GCC_IEC_559_COMPLEX'
  1795. This macro is defined to indicate the intended level of support for
  1796. IEEE 754 (IEC 60559) floating-point arithmetic for complex numbers,
  1797. as defined in C99 and C11 Annex G. It expands to a nonnegative
  1798. integer value. If 0, it indicates that the combination of the
  1799. compiler configuration and the command-line options is not intended
  1800. to support Annex G requirements (for example, because
  1801. '-fcx-limited-range' was used). If 1 or more, it indicates that it
  1802. is intended to support those requirements; this does not mean that
  1803. all relevant language features are supported by GCC.
  1804. '__NO_MATH_ERRNO__'
  1805. This macro is defined if '-fno-math-errno' is used, or enabled by
  1806. another option such as '-ffast-math' or by default.
  1807. 
  1808. File: x86_64-linux-gnu-cpp.info, Node: System-specific Predefined Macros, Next: C++ Named Operators, Prev: Common Predefined Macros, Up: Predefined Macros
  1809. 3.7.3 System-specific Predefined Macros
  1810. ---------------------------------------
  1811. The C preprocessor normally predefines several macros that indicate what
  1812. type of system and machine is in use. They are obviously different on
  1813. each target supported by GCC. This manual, being for all systems and
  1814. machines, cannot tell you what their names are, but you can use 'cpp
  1815. -dM' to see them all. *Note Invocation::. All system-specific
  1816. predefined macros expand to a constant value, so you can test them with
  1817. either '#ifdef' or '#if'.
  1818. The C standard requires that all system-specific macros be part of
  1819. the "reserved namespace". All names which begin with two underscores,
  1820. or an underscore and a capital letter, are reserved for the compiler and
  1821. library to use as they wish. However, historically system-specific
  1822. macros have had names with no special prefix; for instance, it is common
  1823. to find 'unix' defined on Unix systems. For all such macros, GCC
  1824. provides a parallel macro with two underscores added at the beginning
  1825. and the end. If 'unix' is defined, '__unix__' will be defined too.
  1826. There will never be more than two underscores; the parallel of '_mips'
  1827. is '__mips__'.
  1828. When the '-ansi' option, or any '-std' option that requests strict
  1829. conformance, is given to the compiler, all the system-specific
  1830. predefined macros outside the reserved namespace are suppressed. The
  1831. parallel macros, inside the reserved namespace, remain defined.
  1832. We are slowly phasing out all predefined macros which are outside the
  1833. reserved namespace. You should never use them in new programs, and we
  1834. encourage you to correct older code to use the parallel macros whenever
  1835. you find it. We don't recommend you use the system-specific macros that
  1836. are in the reserved namespace, either. It is better in the long run to
  1837. check specifically for features you need, using a tool such as
  1838. 'autoconf'.
  1839. 
  1840. File: x86_64-linux-gnu-cpp.info, Node: C++ Named Operators, Prev: System-specific Predefined Macros, Up: Predefined Macros
  1841. 3.7.4 C++ Named Operators
  1842. -------------------------
  1843. In C++, there are eleven keywords which are simply alternate spellings
  1844. of operators normally written with punctuation. These keywords are
  1845. treated as such even in the preprocessor. They function as operators in
  1846. '#if', and they cannot be defined as macros or poisoned. In C, you can
  1847. request that those keywords take their C++ meaning by including
  1848. 'iso646.h'. That header defines each one as a normal object-like macro
  1849. expanding to the appropriate punctuator.
  1850. These are the named operators and their corresponding punctuators:
  1851. Named Operator Punctuator
  1852. 'and' '&&'
  1853. 'and_eq' '&='
  1854. 'bitand' '&'
  1855. 'bitor' '|'
  1856. 'compl' '~'
  1857. 'not' '!'
  1858. 'not_eq' '!='
  1859. 'or' '||'
  1860. 'or_eq' '|='
  1861. 'xor' '^'
  1862. 'xor_eq' '^='
  1863. 
  1864. File: x86_64-linux-gnu-cpp.info, Node: Undefining and Redefining Macros, Next: Directives Within Macro Arguments, Prev: Predefined Macros, Up: Macros
  1865. 3.8 Undefining and Redefining Macros
  1866. ====================================
  1867. If a macro ceases to be useful, it may be "undefined" with the '#undef'
  1868. directive. '#undef' takes a single argument, the name of the macro to
  1869. undefine. You use the bare macro name, even if the macro is
  1870. function-like. It is an error if anything appears on the line after the
  1871. macro name. '#undef' has no effect if the name is not a macro.
  1872. #define FOO 4
  1873. x = FOO; ==> x = 4;
  1874. #undef FOO
  1875. x = FOO; ==> x = FOO;
  1876. Once a macro has been undefined, that identifier may be "redefined"
  1877. as a macro by a subsequent '#define' directive. The new definition need
  1878. not have any resemblance to the old definition.
  1879. However, if an identifier which is currently a macro is redefined,
  1880. then the new definition must be "effectively the same" as the old one.
  1881. Two macro definitions are effectively the same if:
  1882. * Both are the same type of macro (object- or function-like).
  1883. * All the tokens of the replacement list are the same.
  1884. * If there are any parameters, they are the same.
  1885. * Whitespace appears in the same places in both. It need not be
  1886. exactly the same amount of whitespace, though. Remember that
  1887. comments count as whitespace.
  1888. These definitions are effectively the same:
  1889. #define FOUR (2 + 2)
  1890. #define FOUR (2 + 2)
  1891. #define FOUR (2 /* two */ + 2)
  1892. but these are not:
  1893. #define FOUR (2 + 2)
  1894. #define FOUR ( 2+2 )
  1895. #define FOUR (2 * 2)
  1896. #define FOUR(score,and,seven,years,ago) (2 + 2)
  1897. If a macro is redefined with a definition that is not effectively the
  1898. same as the old one, the preprocessor issues a warning and changes the
  1899. macro to use the new definition. If the new definition is effectively
  1900. the same, the redefinition is silently ignored. This allows, for
  1901. instance, two different headers to define a common macro. The
  1902. preprocessor will only complain if the definitions do not match.
  1903. 
  1904. File: x86_64-linux-gnu-cpp.info, Node: Directives Within Macro Arguments, Next: Macro Pitfalls, Prev: Undefining and Redefining Macros, Up: Macros
  1905. 3.9 Directives Within Macro Arguments
  1906. =====================================
  1907. Occasionally it is convenient to use preprocessor directives within the
  1908. arguments of a macro. The C and C++ standards declare that behavior in
  1909. these cases is undefined. GNU CPP processes arbitrary directives within
  1910. macro arguments in exactly the same way as it would have processed the
  1911. directive were the function-like macro invocation not present.
  1912. If, within a macro invocation, that macro is redefined, then the new
  1913. definition takes effect in time for argument pre-expansion, but the
  1914. original definition is still used for argument replacement. Here is a
  1915. pathological example:
  1916. #define f(x) x x
  1917. f (1
  1918. #undef f
  1919. #define f 2
  1920. f)
  1921. which expands to
  1922. 1 2 1 2
  1923. with the semantics described above.
  1924. 
  1925. File: x86_64-linux-gnu-cpp.info, Node: Macro Pitfalls, Prev: Directives Within Macro Arguments, Up: Macros
  1926. 3.10 Macro Pitfalls
  1927. ===================
  1928. In this section we describe some special rules that apply to macros and
  1929. macro expansion, and point out certain cases in which the rules have
  1930. counter-intuitive consequences that you must watch out for.
  1931. * Menu:
  1932. * Misnesting::
  1933. * Operator Precedence Problems::
  1934. * Swallowing the Semicolon::
  1935. * Duplication of Side Effects::
  1936. * Self-Referential Macros::
  1937. * Argument Prescan::
  1938. * Newlines in Arguments::
  1939. 
  1940. File: x86_64-linux-gnu-cpp.info, Node: Misnesting, Next: Operator Precedence Problems, Up: Macro Pitfalls
  1941. 3.10.1 Misnesting
  1942. -----------------
  1943. When a macro is called with arguments, the arguments are substituted
  1944. into the macro body and the result is checked, together with the rest of
  1945. the input file, for more macro calls. It is possible to piece together
  1946. a macro call coming partially from the macro body and partially from the
  1947. arguments. For example,
  1948. #define twice(x) (2*(x))
  1949. #define call_with_1(x) x(1)
  1950. call_with_1 (twice)
  1951. ==> twice(1)
  1952. ==> (2*(1))
  1953. Macro definitions do not have to have balanced parentheses. By
  1954. writing an unbalanced open parenthesis in a macro body, it is possible
  1955. to create a macro call that begins inside the macro body but ends
  1956. outside of it. For example,
  1957. #define strange(file) fprintf (file, "%s %d",
  1958. ...
  1959. strange(stderr) p, 35)
  1960. ==> fprintf (stderr, "%s %d", p, 35)
  1961. The ability to piece together a macro call can be useful, but the use
  1962. of unbalanced open parentheses in a macro body is just confusing, and
  1963. should be avoided.
  1964. 
  1965. File: x86_64-linux-gnu-cpp.info, Node: Operator Precedence Problems, Next: Swallowing the Semicolon, Prev: Misnesting, Up: Macro Pitfalls
  1966. 3.10.2 Operator Precedence Problems
  1967. -----------------------------------
  1968. You may have noticed that in most of the macro definition examples shown
  1969. above, each occurrence of a macro argument name had parentheses around
  1970. it. In addition, another pair of parentheses usually surround the
  1971. entire macro definition. Here is why it is best to write macros that
  1972. way.
  1973. Suppose you define a macro as follows,
  1974. #define ceil_div(x, y) (x + y - 1) / y
  1975. whose purpose is to divide, rounding up. (One use for this operation is
  1976. to compute how many 'int' objects are needed to hold a certain number of
  1977. 'char' objects.) Then suppose it is used as follows:
  1978. a = ceil_div (b & c, sizeof (int));
  1979. ==> a = (b & c + sizeof (int) - 1) / sizeof (int);
  1980. This does not do what is intended. The operator-precedence rules of C
  1981. make it equivalent to this:
  1982. a = (b & (c + sizeof (int) - 1)) / sizeof (int);
  1983. What we want is this:
  1984. a = ((b & c) + sizeof (int) - 1)) / sizeof (int);
  1985. Defining the macro as
  1986. #define ceil_div(x, y) ((x) + (y) - 1) / (y)
  1987. provides the desired result.
  1988. Unintended grouping can result in another way. Consider 'sizeof
  1989. ceil_div(1, 2)'. That has the appearance of a C expression that would
  1990. compute the size of the type of 'ceil_div (1, 2)', but in fact it means
  1991. something very different. Here is what it expands to:
  1992. sizeof ((1) + (2) - 1) / (2)
  1993. This would take the size of an integer and divide it by two. The
  1994. precedence rules have put the division outside the 'sizeof' when it was
  1995. intended to be inside.
  1996. Parentheses around the entire macro definition prevent such problems.
  1997. Here, then, is the recommended way to define 'ceil_div':
  1998. #define ceil_div(x, y) (((x) + (y) - 1) / (y))
  1999. 
  2000. File: x86_64-linux-gnu-cpp.info, Node: Swallowing the Semicolon, Next: Duplication of Side Effects, Prev: Operator Precedence Problems, Up: Macro Pitfalls
  2001. 3.10.3 Swallowing the Semicolon
  2002. -------------------------------
  2003. Often it is desirable to define a macro that expands into a compound
  2004. statement. Consider, for example, the following macro, that advances a
  2005. pointer (the argument 'p' says where to find it) across whitespace
  2006. characters:
  2007. #define SKIP_SPACES(p, limit) \
  2008. { char *lim = (limit); \
  2009. while (p < lim) { \
  2010. if (*p++ != ' ') { \
  2011. p--; break; }}}
  2012. Here backslash-newline is used to split the macro definition, which must
  2013. be a single logical line, so that it resembles the way such code would
  2014. be laid out if not part of a macro definition.
  2015. A call to this macro might be 'SKIP_SPACES (p, lim)'. Strictly
  2016. speaking, the call expands to a compound statement, which is a complete
  2017. statement with no need for a semicolon to end it. However, since it
  2018. looks like a function call, it minimizes confusion if you can use it
  2019. like a function call, writing a semicolon afterward, as in 'SKIP_SPACES
  2020. (p, lim);'
  2021. This can cause trouble before 'else' statements, because the
  2022. semicolon is actually a null statement. Suppose you write
  2023. if (*p != 0)
  2024. SKIP_SPACES (p, lim);
  2025. else ...
  2026. The presence of two statements--the compound statement and a null
  2027. statement--in between the 'if' condition and the 'else' makes invalid C
  2028. code.
  2029. The definition of the macro 'SKIP_SPACES' can be altered to solve
  2030. this problem, using a 'do ... while' statement. Here is how:
  2031. #define SKIP_SPACES(p, limit) \
  2032. do { char *lim = (limit); \
  2033. while (p < lim) { \
  2034. if (*p++ != ' ') { \
  2035. p--; break; }}} \
  2036. while (0)
  2037. Now 'SKIP_SPACES (p, lim);' expands into
  2038. do {...} while (0);
  2039. which is one statement. The loop executes exactly once; most compilers
  2040. generate no extra code for it.
  2041. 
  2042. File: x86_64-linux-gnu-cpp.info, Node: Duplication of Side Effects, Next: Self-Referential Macros, Prev: Swallowing the Semicolon, Up: Macro Pitfalls
  2043. 3.10.4 Duplication of Side Effects
  2044. ----------------------------------
  2045. Many C programs define a macro 'min', for "minimum", like this:
  2046. #define min(X, Y) ((X) < (Y) ? (X) : (Y))
  2047. When you use this macro with an argument containing a side effect, as
  2048. shown here,
  2049. next = min (x + y, foo (z));
  2050. it expands as follows:
  2051. next = ((x + y) < (foo (z)) ? (x + y) : (foo (z)));
  2052. where 'x + y' has been substituted for 'X' and 'foo (z)' for 'Y'.
  2053. The function 'foo' is used only once in the statement as it appears
  2054. in the program, but the expression 'foo (z)' has been substituted twice
  2055. into the macro expansion. As a result, 'foo' might be called two times
  2056. when the statement is executed. If it has side effects or if it takes a
  2057. long time to compute, the results might not be what you intended. We
  2058. say that 'min' is an "unsafe" macro.
  2059. The best solution to this problem is to define 'min' in a way that
  2060. computes the value of 'foo (z)' only once. The C language offers no
  2061. standard way to do this, but it can be done with GNU extensions as
  2062. follows:
  2063. #define min(X, Y) \
  2064. ({ typeof (X) x_ = (X); \
  2065. typeof (Y) y_ = (Y); \
  2066. (x_ < y_) ? x_ : y_; })
  2067. The '({ ... })' notation produces a compound statement that acts as
  2068. an expression. Its value is the value of its last statement. This
  2069. permits us to define local variables and assign each argument to one.
  2070. The local variables have underscores after their names to reduce the
  2071. risk of conflict with an identifier of wider scope (it is impossible to
  2072. avoid this entirely). Now each argument is evaluated exactly once.
  2073. If you do not wish to use GNU C extensions, the only solution is to
  2074. be careful when _using_ the macro 'min'. For example, you can calculate
  2075. the value of 'foo (z)', save it in a variable, and use that variable in
  2076. 'min':
  2077. #define min(X, Y) ((X) < (Y) ? (X) : (Y))
  2078. ...
  2079. {
  2080. int tem = foo (z);
  2081. next = min (x + y, tem);
  2082. }
  2083. (where we assume that 'foo' returns type 'int').
  2084. 
  2085. File: x86_64-linux-gnu-cpp.info, Node: Self-Referential Macros, Next: Argument Prescan, Prev: Duplication of Side Effects, Up: Macro Pitfalls
  2086. 3.10.5 Self-Referential Macros
  2087. ------------------------------
  2088. A "self-referential" macro is one whose name appears in its definition.
  2089. Recall that all macro definitions are rescanned for more macros to
  2090. replace. If the self-reference were considered a use of the macro, it
  2091. would produce an infinitely large expansion. To prevent this, the
  2092. self-reference is not considered a macro call. It is passed into the
  2093. preprocessor output unchanged. Consider an example:
  2094. #define foo (4 + foo)
  2095. where 'foo' is also a variable in your program.
  2096. Following the ordinary rules, each reference to 'foo' will expand
  2097. into '(4 + foo)'; then this will be rescanned and will expand into '(4 +
  2098. (4 + foo))'; and so on until the computer runs out of memory.
  2099. The self-reference rule cuts this process short after one step, at
  2100. '(4 + foo)'. Therefore, this macro definition has the possibly useful
  2101. effect of causing the program to add 4 to the value of 'foo' wherever
  2102. 'foo' is referred to.
  2103. In most cases, it is a bad idea to take advantage of this feature. A
  2104. person reading the program who sees that 'foo' is a variable will not
  2105. expect that it is a macro as well. The reader will come across the
  2106. identifier 'foo' in the program and think its value should be that of
  2107. the variable 'foo', whereas in fact the value is four greater.
  2108. One common, useful use of self-reference is to create a macro which
  2109. expands to itself. If you write
  2110. #define EPERM EPERM
  2111. then the macro 'EPERM' expands to 'EPERM'. Effectively, it is left
  2112. alone by the preprocessor whenever it's used in running text. You can
  2113. tell that it's a macro with '#ifdef'. You might do this if you want to
  2114. define numeric constants with an 'enum', but have '#ifdef' be true for
  2115. each constant.
  2116. If a macro 'x' expands to use a macro 'y', and the expansion of 'y'
  2117. refers to the macro 'x', that is an "indirect self-reference" of 'x'.
  2118. 'x' is not expanded in this case either. Thus, if we have
  2119. #define x (4 + y)
  2120. #define y (2 * x)
  2121. then 'x' and 'y' expand as follows:
  2122. x ==> (4 + y)
  2123. ==> (4 + (2 * x))
  2124. y ==> (2 * x)
  2125. ==> (2 * (4 + y))
  2126. Each macro is expanded when it appears in the definition of the other
  2127. macro, but not when it indirectly appears in its own definition.
  2128. 
  2129. File: x86_64-linux-gnu-cpp.info, Node: Argument Prescan, Next: Newlines in Arguments, Prev: Self-Referential Macros, Up: Macro Pitfalls
  2130. 3.10.6 Argument Prescan
  2131. -----------------------
  2132. Macro arguments are completely macro-expanded before they are
  2133. substituted into a macro body, unless they are stringized or pasted with
  2134. other tokens. After substitution, the entire macro body, including the
  2135. substituted arguments, is scanned again for macros to be expanded. The
  2136. result is that the arguments are scanned _twice_ to expand macro calls
  2137. in them.
  2138. Most of the time, this has no effect. If the argument contained any
  2139. macro calls, they are expanded during the first scan. The result
  2140. therefore contains no macro calls, so the second scan does not change
  2141. it. If the argument were substituted as given, with no prescan, the
  2142. single remaining scan would find the same macro calls and produce the
  2143. same results.
  2144. You might expect the double scan to change the results when a
  2145. self-referential macro is used in an argument of another macro (*note
  2146. Self-Referential Macros::): the self-referential macro would be expanded
  2147. once in the first scan, and a second time in the second scan. However,
  2148. this is not what happens. The self-references that do not expand in the
  2149. first scan are marked so that they will not expand in the second scan
  2150. either.
  2151. You might wonder, "Why mention the prescan, if it makes no
  2152. difference? And why not skip it and make the preprocessor faster?" The
  2153. answer is that the prescan does make a difference in three special
  2154. cases:
  2155. * Nested calls to a macro.
  2156. We say that "nested" calls to a macro occur when a macro's argument
  2157. contains a call to that very macro. For example, if 'f' is a macro
  2158. that expects one argument, 'f (f (1))' is a nested pair of calls to
  2159. 'f'. The desired expansion is made by expanding 'f (1)' and
  2160. substituting that into the definition of 'f'. The prescan causes
  2161. the expected result to happen. Without the prescan, 'f (1)' itself
  2162. would be substituted as an argument, and the inner use of 'f' would
  2163. appear during the main scan as an indirect self-reference and would
  2164. not be expanded.
  2165. * Macros that call other macros that stringize or concatenate.
  2166. If an argument is stringized or concatenated, the prescan does not
  2167. occur. If you _want_ to expand a macro, then stringize or
  2168. concatenate its expansion, you can do that by causing one macro to
  2169. call another macro that does the stringizing or concatenation. For
  2170. instance, if you have
  2171. #define AFTERX(x) X_ ## x
  2172. #define XAFTERX(x) AFTERX(x)
  2173. #define TABLESIZE 1024
  2174. #define BUFSIZE TABLESIZE
  2175. then 'AFTERX(BUFSIZE)' expands to 'X_BUFSIZE', and
  2176. 'XAFTERX(BUFSIZE)' expands to 'X_1024'. (Not to 'X_TABLESIZE'.
  2177. Prescan always does a complete expansion.)
  2178. * Macros used in arguments, whose expansions contain unshielded
  2179. commas.
  2180. This can cause a macro expanded on the second scan to be called
  2181. with the wrong number of arguments. Here is an example:
  2182. #define foo a,b
  2183. #define bar(x) lose(x)
  2184. #define lose(x) (1 + (x))
  2185. We would like 'bar(foo)' to turn into '(1 + (foo))', which would
  2186. then turn into '(1 + (a,b))'. Instead, 'bar(foo)' expands into
  2187. 'lose(a,b)', and you get an error because 'lose' requires a single
  2188. argument. In this case, the problem is easily solved by the same
  2189. parentheses that ought to be used to prevent misnesting of
  2190. arithmetic operations:
  2191. #define foo (a,b)
  2192. or
  2193. #define bar(x) lose((x))
  2194. The extra pair of parentheses prevents the comma in 'foo''s
  2195. definition from being interpreted as an argument separator.
  2196. 
  2197. File: x86_64-linux-gnu-cpp.info, Node: Newlines in Arguments, Prev: Argument Prescan, Up: Macro Pitfalls
  2198. 3.10.7 Newlines in Arguments
  2199. ----------------------------
  2200. The invocation of a function-like macro can extend over many logical
  2201. lines. However, in the present implementation, the entire expansion
  2202. comes out on one line. Thus line numbers emitted by the compiler or
  2203. debugger refer to the line the invocation started on, which might be
  2204. different to the line containing the argument causing the problem.
  2205. Here is an example illustrating this:
  2206. #define ignore_second_arg(a,b,c) a; c
  2207. ignore_second_arg (foo (),
  2208. ignored (),
  2209. syntax error);
  2210. The syntax error triggered by the tokens 'syntax error' results in an
  2211. error message citing line three--the line of ignore_second_arg-- even
  2212. though the problematic code comes from line five.
  2213. We consider this a bug, and intend to fix it in the near future.
  2214. 
  2215. File: x86_64-linux-gnu-cpp.info, Node: Conditionals, Next: Diagnostics, Prev: Macros, Up: Top
  2216. 4 Conditionals
  2217. **************
  2218. A "conditional" is a directive that instructs the preprocessor to select
  2219. whether or not to include a chunk of code in the final token stream
  2220. passed to the compiler. Preprocessor conditionals can test arithmetic
  2221. expressions, or whether a name is defined as a macro, or both
  2222. simultaneously using the special 'defined' operator.
  2223. A conditional in the C preprocessor resembles in some ways an 'if'
  2224. statement in C, but it is important to understand the difference between
  2225. them. The condition in an 'if' statement is tested during the execution
  2226. of your program. Its purpose is to allow your program to behave
  2227. differently from run to run, depending on the data it is operating on.
  2228. The condition in a preprocessing conditional directive is tested when
  2229. your program is compiled. Its purpose is to allow different code to be
  2230. included in the program depending on the situation at the time of
  2231. compilation.
  2232. However, the distinction is becoming less clear. Modern compilers
  2233. often do test 'if' statements when a program is compiled, if their
  2234. conditions are known not to vary at run time, and eliminate code which
  2235. can never be executed. If you can count on your compiler to do this,
  2236. you may find that your program is more readable if you use 'if'
  2237. statements with constant conditions (perhaps determined by macros). Of
  2238. course, you can only use this to exclude code, not type definitions or
  2239. other preprocessing directives, and you can only do it if the code
  2240. remains syntactically valid when it is not to be used.
  2241. * Menu:
  2242. * Conditional Uses::
  2243. * Conditional Syntax::
  2244. * Deleted Code::
  2245. 
  2246. File: x86_64-linux-gnu-cpp.info, Node: Conditional Uses, Next: Conditional Syntax, Up: Conditionals
  2247. 4.1 Conditional Uses
  2248. ====================
  2249. There are three general reasons to use a conditional.
  2250. * A program may need to use different code depending on the machine
  2251. or operating system it is to run on. In some cases the code for
  2252. one operating system may be erroneous on another operating system;
  2253. for example, it might refer to data types or constants that do not
  2254. exist on the other system. When this happens, it is not enough to
  2255. avoid executing the invalid code. Its mere presence will cause the
  2256. compiler to reject the program. With a preprocessing conditional,
  2257. the offending code can be effectively excised from the program when
  2258. it is not valid.
  2259. * You may want to be able to compile the same source file into two
  2260. different programs. One version might make frequent time-consuming
  2261. consistency checks on its intermediate data, or print the values of
  2262. those data for debugging, and the other not.
  2263. * A conditional whose condition is always false is one way to exclude
  2264. code from the program but keep it as a sort of comment for future
  2265. reference.
  2266. Simple programs that do not need system-specific logic or complex
  2267. debugging hooks generally will not need to use preprocessing
  2268. conditionals.
  2269. 
  2270. File: x86_64-linux-gnu-cpp.info, Node: Conditional Syntax, Next: Deleted Code, Prev: Conditional Uses, Up: Conditionals
  2271. 4.2 Conditional Syntax
  2272. ======================
  2273. A conditional in the C preprocessor begins with a "conditional
  2274. directive": '#if', '#ifdef' or '#ifndef'.
  2275. * Menu:
  2276. * Ifdef::
  2277. * If::
  2278. * Defined::
  2279. * Else::
  2280. * Elif::
  2281. * __has_attribute::
  2282. * __has_cpp_attribute::
  2283. * __has_include::
  2284. 
  2285. File: x86_64-linux-gnu-cpp.info, Node: Ifdef, Next: If, Up: Conditional Syntax
  2286. 4.2.1 Ifdef
  2287. -----------
  2288. The simplest sort of conditional is
  2289. #ifdef MACRO
  2290. CONTROLLED TEXT
  2291. #endif /* MACRO */
  2292. This block is called a "conditional group". CONTROLLED TEXT will be
  2293. included in the output of the preprocessor if and only if MACRO is
  2294. defined. We say that the conditional "succeeds" if MACRO is defined,
  2295. "fails" if it is not.
  2296. The CONTROLLED TEXT inside of a conditional can include preprocessing
  2297. directives. They are executed only if the conditional succeeds. You
  2298. can nest conditional groups inside other conditional groups, but they
  2299. must be completely nested. In other words, '#endif' always matches the
  2300. nearest '#ifdef' (or '#ifndef', or '#if'). Also, you cannot start a
  2301. conditional group in one file and end it in another.
  2302. Even if a conditional fails, the CONTROLLED TEXT inside it is still
  2303. run through initial transformations and tokenization. Therefore, it
  2304. must all be lexically valid C. Normally the only way this matters is
  2305. that all comments and string literals inside a failing conditional group
  2306. must still be properly ended.
  2307. The comment following the '#endif' is not required, but it is a good
  2308. practice if there is a lot of CONTROLLED TEXT, because it helps people
  2309. match the '#endif' to the corresponding '#ifdef'. Older programs
  2310. sometimes put MACRO directly after the '#endif' without enclosing it in
  2311. a comment. This is invalid code according to the C standard. CPP
  2312. accepts it with a warning. It never affects which '#ifndef' the
  2313. '#endif' matches.
  2314. Sometimes you wish to use some code if a macro is _not_ defined. You
  2315. can do this by writing '#ifndef' instead of '#ifdef'. One common use of
  2316. '#ifndef' is to include code only the first time a header file is
  2317. included. *Note Once-Only Headers::.
  2318. Macro definitions can vary between compilations for several reasons.
  2319. Here are some samples.
  2320. * Some macros are predefined on each kind of machine (*note
  2321. System-specific Predefined Macros::). This allows you to provide
  2322. code specially tuned for a particular machine.
  2323. * System header files define more macros, associated with the
  2324. features they implement. You can test these macros with
  2325. conditionals to avoid using a system feature on a machine where it
  2326. is not implemented.
  2327. * Macros can be defined or undefined with the '-D' and '-U'
  2328. command-line options when you compile the program. You can arrange
  2329. to compile the same source file into two different programs by
  2330. choosing a macro name to specify which program you want, writing
  2331. conditionals to test whether or how this macro is defined, and then
  2332. controlling the state of the macro with command-line options,
  2333. perhaps set in the Makefile. *Note Invocation::.
  2334. * Your program might have a special header file (often called
  2335. 'config.h') that is adjusted when the program is compiled. It can
  2336. define or not define macros depending on the features of the system
  2337. and the desired capabilities of the program. The adjustment can be
  2338. automated by a tool such as 'autoconf', or done by hand.
  2339. 
  2340. File: x86_64-linux-gnu-cpp.info, Node: If, Next: Defined, Prev: Ifdef, Up: Conditional Syntax
  2341. 4.2.2 If
  2342. --------
  2343. The '#if' directive allows you to test the value of an arithmetic
  2344. expression, rather than the mere existence of one macro. Its syntax is
  2345. #if EXPRESSION
  2346. CONTROLLED TEXT
  2347. #endif /* EXPRESSION */
  2348. EXPRESSION is a C expression of integer type, subject to stringent
  2349. restrictions. It may contain
  2350. * Integer constants.
  2351. * Character constants, which are interpreted as they would be in
  2352. normal code.
  2353. * Arithmetic operators for addition, subtraction, multiplication,
  2354. division, bitwise operations, shifts, comparisons, and logical
  2355. operations ('&&' and '||'). The latter two obey the usual
  2356. short-circuiting rules of standard C.
  2357. * Macros. All macros in the expression are expanded before actual
  2358. computation of the expression's value begins.
  2359. * Uses of the 'defined' operator, which lets you check whether macros
  2360. are defined in the middle of an '#if'.
  2361. * Identifiers that are not macros, which are all considered to be the
  2362. number zero. This allows you to write '#if MACRO' instead of
  2363. '#ifdef MACRO', if you know that MACRO, when defined, will always
  2364. have a nonzero value. Function-like macros used without their
  2365. function call parentheses are also treated as zero.
  2366. In some contexts this shortcut is undesirable. The '-Wundef'
  2367. option causes GCC to warn whenever it encounters an identifier
  2368. which is not a macro in an '#if'.
  2369. The preprocessor does not know anything about types in the language.
  2370. Therefore, 'sizeof' operators are not recognized in '#if', and neither
  2371. are 'enum' constants. They will be taken as identifiers which are not
  2372. macros, and replaced by zero. In the case of 'sizeof', this is likely
  2373. to cause the expression to be invalid.
  2374. The preprocessor calculates the value of EXPRESSION. It carries out
  2375. all calculations in the widest integer type known to the compiler; on
  2376. most machines supported by GCC this is 64 bits. This is not the same
  2377. rule as the compiler uses to calculate the value of a constant
  2378. expression, and may give different results in some cases. If the value
  2379. comes out to be nonzero, the '#if' succeeds and the CONTROLLED TEXT is
  2380. included; otherwise it is skipped.
  2381. 
  2382. File: x86_64-linux-gnu-cpp.info, Node: Defined, Next: Else, Prev: If, Up: Conditional Syntax
  2383. 4.2.3 Defined
  2384. -------------
  2385. The special operator 'defined' is used in '#if' and '#elif' expressions
  2386. to test whether a certain name is defined as a macro. 'defined NAME'
  2387. and 'defined (NAME)' are both expressions whose value is 1 if NAME is
  2388. defined as a macro at the current point in the program, and 0 otherwise.
  2389. Thus, '#if defined MACRO' is precisely equivalent to '#ifdef MACRO'.
  2390. 'defined' is useful when you wish to test more than one macro for
  2391. existence at once. For example,
  2392. #if defined (__vax__) || defined (__ns16000__)
  2393. would succeed if either of the names '__vax__' or '__ns16000__' is
  2394. defined as a macro.
  2395. Conditionals written like this:
  2396. #if defined BUFSIZE && BUFSIZE >= 1024
  2397. can generally be simplified to just '#if BUFSIZE >= 1024', since if
  2398. 'BUFSIZE' is not defined, it will be interpreted as having the value
  2399. zero.
  2400. If the 'defined' operator appears as a result of a macro expansion,
  2401. the C standard says the behavior is undefined. GNU cpp treats it as a
  2402. genuine 'defined' operator and evaluates it normally. It will warn
  2403. wherever your code uses this feature if you use the command-line option
  2404. '-Wpedantic', since other compilers may handle it differently. The
  2405. warning is also enabled by '-Wextra', and can also be enabled
  2406. individually with '-Wexpansion-to-defined'.
  2407. 
  2408. File: x86_64-linux-gnu-cpp.info, Node: Else, Next: Elif, Prev: Defined, Up: Conditional Syntax
  2409. 4.2.4 Else
  2410. ----------
  2411. The '#else' directive can be added to a conditional to provide
  2412. alternative text to be used if the condition fails. This is what it
  2413. looks like:
  2414. #if EXPRESSION
  2415. TEXT-IF-TRUE
  2416. #else /* Not EXPRESSION */
  2417. TEXT-IF-FALSE
  2418. #endif /* Not EXPRESSION */
  2419. If EXPRESSION is nonzero, the TEXT-IF-TRUE is included and the
  2420. TEXT-IF-FALSE is skipped. If EXPRESSION is zero, the opposite happens.
  2421. You can use '#else' with '#ifdef' and '#ifndef', too.
  2422. 
  2423. File: x86_64-linux-gnu-cpp.info, Node: Elif, Next: __has_attribute, Prev: Else, Up: Conditional Syntax
  2424. 4.2.5 Elif
  2425. ----------
  2426. One common case of nested conditionals is used to check for more than
  2427. two possible alternatives. For example, you might have
  2428. #if X == 1
  2429. ...
  2430. #else /* X != 1 */
  2431. #if X == 2
  2432. ...
  2433. #else /* X != 2 */
  2434. ...
  2435. #endif /* X != 2 */
  2436. #endif /* X != 1 */
  2437. Another conditional directive, '#elif', allows this to be abbreviated
  2438. as follows:
  2439. #if X == 1
  2440. ...
  2441. #elif X == 2
  2442. ...
  2443. #else /* X != 2 and X != 1*/
  2444. ...
  2445. #endif /* X != 2 and X != 1*/
  2446. '#elif' stands for "else if". Like '#else', it goes in the middle of
  2447. a conditional group and subdivides it; it does not require a matching
  2448. '#endif' of its own. Like '#if', the '#elif' directive includes an
  2449. expression to be tested. The text following the '#elif' is processed
  2450. only if the original '#if'-condition failed and the '#elif' condition
  2451. succeeds.
  2452. More than one '#elif' can go in the same conditional group. Then the
  2453. text after each '#elif' is processed only if the '#elif' condition
  2454. succeeds after the original '#if' and all previous '#elif' directives
  2455. within it have failed.
  2456. '#else' is allowed after any number of '#elif' directives, but
  2457. '#elif' may not follow '#else'.
  2458. 
  2459. File: x86_64-linux-gnu-cpp.info, Node: __has_attribute, Next: __has_cpp_attribute, Prev: Elif, Up: Conditional Syntax
  2460. 4.2.6 '__has_attribute'
  2461. -----------------------
  2462. The special operator '__has_attribute (OPERAND)' may be used in '#if'
  2463. and '#elif' expressions to test whether the attribute referenced by its
  2464. OPERAND is recognized by GCC. Using the operator in other contexts is
  2465. not valid. In C code, OPERAND must be a valid identifier. In C++ code,
  2466. OPERAND may be optionally introduced by the 'ATTRIBUTE-SCOPE::' prefix.
  2467. The ATTRIBUTE-SCOPE prefix identifies the "namespace" within which the
  2468. attribute is recognized. The scope of GCC attributes is 'gnu' or
  2469. '__gnu__'. The '__has_attribute' operator by itself, without any
  2470. OPERAND or parentheses, acts as a predefined macro so that support for
  2471. it can be tested in portable code. Thus, the recommended use of the
  2472. operator is as follows:
  2473. #if defined __has_attribute
  2474. # if __has_attribute (nonnull)
  2475. # define ATTR_NONNULL __attribute__ ((nonnull))
  2476. # endif
  2477. #endif
  2478. The first '#if' test succeeds only when the operator is supported by
  2479. the version of GCC (or another compiler) being used. Only when that
  2480. test succeeds is it valid to use '__has_attribute' as a preprocessor
  2481. operator. As a result, combining the two tests into a single expression
  2482. as shown below would only be valid with a compiler that supports the
  2483. operator but not with others that don't.
  2484. #if defined __has_attribute && __has_attribute (nonnull) /* not portable */
  2485. ...
  2486. #endif
  2487. 
  2488. File: x86_64-linux-gnu-cpp.info, Node: __has_cpp_attribute, Next: __has_include, Prev: __has_attribute, Up: Conditional Syntax
  2489. 4.2.7 '__has_cpp_attribute'
  2490. ---------------------------
  2491. The special operator '__has_cpp_attribute (OPERAND)' may be used in
  2492. '#if' and '#elif' expressions in C++ code to test whether the attribute
  2493. referenced by its OPERAND is recognized by GCC. '__has_cpp_attribute
  2494. (OPERAND)' is equivalent to '__has_attribute (OPERAND)' except that when
  2495. OPERAND designates a supported standard attribute it evaluates to an
  2496. integer constant of the form 'YYYYMM' indicating the year and month when
  2497. the attribute was first introduced into the C++ standard. For
  2498. additional information including the dates of the introduction of
  2499. current standard attributes, see
  2500. SD-6: SG10 Feature Test Recommendations (https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations/).
  2501. 
  2502. File: x86_64-linux-gnu-cpp.info, Node: __has_include, Prev: __has_cpp_attribute, Up: Conditional Syntax
  2503. 4.2.8 '__has_include'
  2504. ---------------------
  2505. The special operator '__has_include (OPERAND)' may be used in '#if' and
  2506. '#elif' expressions to test whether the header referenced by its OPERAND
  2507. can be included using the '#include' directive. Using the operator in
  2508. other contexts is not valid. The OPERAND takes the same form as the
  2509. file in the '#include' directive (*note Include Syntax::) and evaluates
  2510. to a nonzero value if the header can be included and to zero otherwise.
  2511. Note that that the ability to include a header doesn't imply that the
  2512. header doesn't contain invalid constructs or '#error' directives that
  2513. would cause the preprocessor to fail.
  2514. The '__has_include' operator by itself, without any OPERAND or
  2515. parentheses, acts as a predefined macro so that support for it can be
  2516. tested in portable code. Thus, the recommended use of the operator is
  2517. as follows:
  2518. #if defined __has_include
  2519. # if __has_include (<stdatomic.h>)
  2520. # include <stdatomic.h>
  2521. # endif
  2522. #endif
  2523. The first '#if' test succeeds only when the operator is supported by
  2524. the version of GCC (or another compiler) being used. Only when that
  2525. test succeeds is it valid to use '__has_include' as a preprocessor
  2526. operator. As a result, combining the two tests into a single expression
  2527. as shown below would only be valid with a compiler that supports the
  2528. operator but not with others that don't.
  2529. #if defined __has_include && __has_include ("header.h") /* not portable */
  2530. ...
  2531. #endif
  2532. 
  2533. File: x86_64-linux-gnu-cpp.info, Node: Deleted Code, Prev: Conditional Syntax, Up: Conditionals
  2534. 4.3 Deleted Code
  2535. ================
  2536. If you replace or delete a part of the program but want to keep the old
  2537. code around for future reference, you often cannot simply comment it
  2538. out. Block comments do not nest, so the first comment inside the old
  2539. code will end the commenting-out. The probable result is a flood of
  2540. syntax errors.
  2541. One way to avoid this problem is to use an always-false conditional
  2542. instead. For instance, put '#if 0' before the deleted code and '#endif'
  2543. after it. This works even if the code being turned off contains
  2544. conditionals, but they must be entire conditionals (balanced '#if' and
  2545. '#endif').
  2546. Some people use '#ifdef notdef' instead. This is risky, because
  2547. 'notdef' might be accidentally defined as a macro, and then the
  2548. conditional would succeed. '#if 0' can be counted on to fail.
  2549. Do not use '#if 0' for comments which are not C code. Use a real
  2550. comment, instead. The interior of '#if 0' must consist of complete
  2551. tokens; in particular, single-quote characters must balance. Comments
  2552. often contain unbalanced single-quote characters (known in English as
  2553. apostrophes). These confuse '#if 0'. They don't confuse '/*'.
  2554. 
  2555. File: x86_64-linux-gnu-cpp.info, Node: Diagnostics, Next: Line Control, Prev: Conditionals, Up: Top
  2556. 5 Diagnostics
  2557. *************
  2558. The directive '#error' causes the preprocessor to report a fatal error.
  2559. The tokens forming the rest of the line following '#error' are used as
  2560. the error message.
  2561. You would use '#error' inside of a conditional that detects a
  2562. combination of parameters which you know the program does not properly
  2563. support. For example, if you know that the program will not run
  2564. properly on a VAX, you might write
  2565. #ifdef __vax__
  2566. #error "Won't work on VAXen. See comments at get_last_object."
  2567. #endif
  2568. If you have several configuration parameters that must be set up by
  2569. the installation in a consistent way, you can use conditionals to detect
  2570. an inconsistency and report it with '#error'. For example,
  2571. #if !defined(FOO) && defined(BAR)
  2572. #error "BAR requires FOO."
  2573. #endif
  2574. The directive '#warning' is like '#error', but causes the
  2575. preprocessor to issue a warning and continue preprocessing. The tokens
  2576. following '#warning' are used as the warning message.
  2577. You might use '#warning' in obsolete header files, with a message
  2578. directing the user to the header file which should be used instead.
  2579. Neither '#error' nor '#warning' macro-expands its argument. Internal
  2580. whitespace sequences are each replaced with a single space. The line
  2581. must consist of complete tokens. It is wisest to make the argument of
  2582. these directives be a single string constant; this avoids problems with
  2583. apostrophes and the like.
  2584. 
  2585. File: x86_64-linux-gnu-cpp.info, Node: Line Control, Next: Pragmas, Prev: Diagnostics, Up: Top
  2586. 6 Line Control
  2587. **************
  2588. The C preprocessor informs the C compiler of the location in your source
  2589. code where each token came from. Presently, this is just the file name
  2590. and line number. All the tokens resulting from macro expansion are
  2591. reported as having appeared on the line of the source file where the
  2592. outermost macro was used. We intend to be more accurate in the future.
  2593. If you write a program which generates source code, such as the
  2594. 'bison' parser generator, you may want to adjust the preprocessor's
  2595. notion of the current file name and line number by hand. Parts of the
  2596. output from 'bison' are generated from scratch, other parts come from a
  2597. standard parser file. The rest are copied verbatim from 'bison''s
  2598. input. You would like compiler error messages and symbolic debuggers to
  2599. be able to refer to 'bison''s input file.
  2600. 'bison' or any such program can arrange this by writing '#line'
  2601. directives into the output file. '#line' is a directive that specifies
  2602. the original line number and source file name for subsequent input in
  2603. the current preprocessor input file. '#line' has three variants:
  2604. '#line LINENUM'
  2605. LINENUM is a non-negative decimal integer constant. It specifies
  2606. the line number which should be reported for the following line of
  2607. input. Subsequent lines are counted from LINENUM.
  2608. '#line LINENUM FILENAME'
  2609. LINENUM is the same as for the first form, and has the same effect.
  2610. In addition, FILENAME is a string constant. The following line and
  2611. all subsequent lines are reported to come from the file it
  2612. specifies, until something else happens to change that. FILENAME
  2613. is interpreted according to the normal rules for a string constant:
  2614. backslash escapes are interpreted. This is different from
  2615. '#include'.
  2616. '#line ANYTHING ELSE'
  2617. ANYTHING ELSE is checked for macro calls, which are expanded. The
  2618. result should match one of the above two forms.
  2619. '#line' directives alter the results of the '__FILE__' and '__LINE__'
  2620. predefined macros from that point on. *Note Standard Predefined
  2621. Macros::. They do not have any effect on '#include''s idea of the
  2622. directory containing the current file.
  2623. 
  2624. File: x86_64-linux-gnu-cpp.info, Node: Pragmas, Next: Other Directives, Prev: Line Control, Up: Top
  2625. 7 Pragmas
  2626. *********
  2627. The '#pragma' directive is the method specified by the C standard for
  2628. providing additional information to the compiler, beyond what is
  2629. conveyed in the language itself. The forms of this directive (commonly
  2630. known as "pragmas") specified by C standard are prefixed with 'STDC'. A
  2631. C compiler is free to attach any meaning it likes to other pragmas.
  2632. Most GNU-defined, supported pragmas have been given a 'GCC' prefix.
  2633. C99 introduced the '_Pragma' operator. This feature addresses a
  2634. major problem with '#pragma': being a directive, it cannot be produced
  2635. as the result of macro expansion. '_Pragma' is an operator, much like
  2636. 'sizeof' or 'defined', and can be embedded in a macro.
  2637. Its syntax is '_Pragma (STRING-LITERAL)', where STRING-LITERAL can be
  2638. either a normal or wide-character string literal. It is destringized,
  2639. by replacing all '\\' with a single '\' and all '\"' with a '"'. The
  2640. result is then processed as if it had appeared as the right hand side of
  2641. a '#pragma' directive. For example,
  2642. _Pragma ("GCC dependency \"parse.y\"")
  2643. has the same effect as '#pragma GCC dependency "parse.y"'. The same
  2644. effect could be achieved using macros, for example
  2645. #define DO_PRAGMA(x) _Pragma (#x)
  2646. DO_PRAGMA (GCC dependency "parse.y")
  2647. The standard is unclear on where a '_Pragma' operator can appear.
  2648. The preprocessor does not accept it within a preprocessing conditional
  2649. directive like '#if'. To be safe, you are probably best keeping it out
  2650. of directives other than '#define', and putting it on a line of its own.
  2651. This manual documents the pragmas which are meaningful to the
  2652. preprocessor itself. Other pragmas are meaningful to the C or C++
  2653. compilers. They are documented in the GCC manual.
  2654. GCC plugins may provide their own pragmas.
  2655. '#pragma GCC dependency'
  2656. '#pragma GCC dependency' allows you to check the relative dates of
  2657. the current file and another file. If the other file is more
  2658. recent than the current file, a warning is issued. This is useful
  2659. if the current file is derived from the other file, and should be
  2660. regenerated. The other file is searched for using the normal
  2661. include search path. Optional trailing text can be used to give
  2662. more information in the warning message.
  2663. #pragma GCC dependency "parse.y"
  2664. #pragma GCC dependency "/usr/include/time.h" rerun fixincludes
  2665. '#pragma GCC poison'
  2666. Sometimes, there is an identifier that you want to remove
  2667. completely from your program, and make sure that it never creeps
  2668. back in. To enforce this, you can "poison" the identifier with
  2669. this pragma. '#pragma GCC poison' is followed by a list of
  2670. identifiers to poison. If any of those identifiers appears
  2671. anywhere in the source after the directive, it is a hard error.
  2672. For example,
  2673. #pragma GCC poison printf sprintf fprintf
  2674. sprintf(some_string, "hello");
  2675. will produce an error.
  2676. If a poisoned identifier appears as part of the expansion of a
  2677. macro which was defined before the identifier was poisoned, it will
  2678. _not_ cause an error. This lets you poison an identifier without
  2679. worrying about system headers defining macros that use it.
  2680. For example,
  2681. #define strrchr rindex
  2682. #pragma GCC poison rindex
  2683. strrchr(some_string, 'h');
  2684. will not produce an error.
  2685. '#pragma GCC system_header'
  2686. This pragma takes no arguments. It causes the rest of the code in
  2687. the current file to be treated as if it came from a system header.
  2688. *Note System Headers::.
  2689. '#pragma GCC warning'
  2690. '#pragma GCC error'
  2691. '#pragma GCC warning "message"' causes the preprocessor to issue a
  2692. warning diagnostic with the text 'message'. The message contained
  2693. in the pragma must be a single string literal. Similarly, '#pragma
  2694. GCC error "message"' issues an error message. Unlike the
  2695. '#warning' and '#error' directives, these pragmas can be embedded
  2696. in preprocessor macros using '_Pragma'.
  2697. '#pragma once'
  2698. If '#pragma once' is seen when scanning a header file, that file
  2699. will never be read again, no matter what. It is a less-portable
  2700. alternative to using '#ifndef' to guard the contents of header
  2701. files against multiple inclusions.
  2702. 
  2703. File: x86_64-linux-gnu-cpp.info, Node: Other Directives, Next: Preprocessor Output, Prev: Pragmas, Up: Top
  2704. 8 Other Directives
  2705. ******************
  2706. The '#ident' directive takes one argument, a string constant. On some
  2707. systems, that string constant is copied into a special segment of the
  2708. object file. On other systems, the directive is ignored. The '#sccs'
  2709. directive is a synonym for '#ident'.
  2710. These directives are not part of the C standard, but they are not
  2711. official GNU extensions either. What historical information we have
  2712. been able to find, suggests they originated with System V.
  2713. The "null directive" consists of a '#' followed by a newline, with
  2714. only whitespace (including comments) in between. A null directive is
  2715. understood as a preprocessing directive but has no effect on the
  2716. preprocessor output. The primary significance of the existence of the
  2717. null directive is that an input line consisting of just a '#' will
  2718. produce no output, rather than a line of output containing just a '#'.
  2719. Supposedly some old C programs contain such lines.
  2720. 
  2721. File: x86_64-linux-gnu-cpp.info, Node: Preprocessor Output, Next: Traditional Mode, Prev: Other Directives, Up: Top
  2722. 9 Preprocessor Output
  2723. *********************
  2724. When the C preprocessor is used with the C, C++, or Objective-C
  2725. compilers, it is integrated into the compiler and communicates a stream
  2726. of binary tokens directly to the compiler's parser. However, it can
  2727. also be used in the more conventional standalone mode, where it produces
  2728. textual output.
  2729. The output from the C preprocessor looks much like the input, except
  2730. that all preprocessing directive lines have been replaced with blank
  2731. lines and all comments with spaces. Long runs of blank lines are
  2732. discarded.
  2733. The ISO standard specifies that it is implementation defined whether
  2734. a preprocessor preserves whitespace between tokens, or replaces it with
  2735. e.g. a single space. In GNU CPP, whitespace between tokens is collapsed
  2736. to become a single space, with the exception that the first token on a
  2737. non-directive line is preceded with sufficient spaces that it appears in
  2738. the same column in the preprocessed output that it appeared in the
  2739. original source file. This is so the output is easy to read. CPP does
  2740. not insert any whitespace where there was none in the original source,
  2741. except where necessary to prevent an accidental token paste.
  2742. Source file name and line number information is conveyed by lines of
  2743. the form
  2744. # LINENUM FILENAME FLAGS
  2745. These are called "linemarkers". They are inserted as needed into the
  2746. output (but never within a string or character constant). They mean
  2747. that the following line originated in file FILENAME at line LINENUM.
  2748. FILENAME will never contain any non-printing characters; they are
  2749. replaced with octal escape sequences.
  2750. After the file name comes zero or more flags, which are '1', '2',
  2751. '3', or '4'. If there are multiple flags, spaces separate them. Here
  2752. is what the flags mean:
  2753. '1'
  2754. This indicates the start of a new file.
  2755. '2'
  2756. This indicates returning to a file (after having included another
  2757. file).
  2758. '3'
  2759. This indicates that the following text comes from a system header
  2760. file, so certain warnings should be suppressed.
  2761. '4'
  2762. This indicates that the following text should be treated as being
  2763. wrapped in an implicit 'extern "C"' block.
  2764. As an extension, the preprocessor accepts linemarkers in
  2765. non-assembler input files. They are treated like the corresponding
  2766. '#line' directive, (*note Line Control::), except that trailing flags
  2767. are permitted, and are interpreted with the meanings described above.
  2768. If multiple flags are given, they must be in ascending order.
  2769. Some directives may be duplicated in the output of the preprocessor.
  2770. These are '#ident' (always), '#pragma' (only if the preprocessor does
  2771. not handle the pragma itself), and '#define' and '#undef' (with certain
  2772. debugging options). If this happens, the '#' of the directive will
  2773. always be in the first column, and there will be no space between the
  2774. '#' and the directive name. If macro expansion happens to generate
  2775. tokens which might be mistaken for a duplicated directive, a space will
  2776. be inserted between the '#' and the directive name.
  2777. 
  2778. File: x86_64-linux-gnu-cpp.info, Node: Traditional Mode, Next: Implementation Details, Prev: Preprocessor Output, Up: Top
  2779. 10 Traditional Mode
  2780. *******************
  2781. Traditional (pre-standard) C preprocessing is rather different from the
  2782. preprocessing specified by the standard. When the preprocessor is
  2783. invoked with the '-traditional-cpp' option, it attempts to emulate a
  2784. traditional preprocessor.
  2785. This mode is not useful for compiling C code with GCC, but is
  2786. intended for use with non-C preprocessing applications. Thus
  2787. traditional mode semantics are supported only when invoking the
  2788. preprocessor explicitly, and not in the compiler front ends.
  2789. The implementation does not correspond precisely to the behavior of
  2790. early pre-standard versions of GCC, nor to any true traditional
  2791. preprocessor. After all, inconsistencies among traditional
  2792. implementations were a major motivation for C standardization. However,
  2793. we intend that it should be compatible with true traditional
  2794. preprocessors in all ways that actually matter.
  2795. * Menu:
  2796. * Traditional lexical analysis::
  2797. * Traditional macros::
  2798. * Traditional miscellany::
  2799. * Traditional warnings::
  2800. 
  2801. File: x86_64-linux-gnu-cpp.info, Node: Traditional lexical analysis, Next: Traditional macros, Up: Traditional Mode
  2802. 10.1 Traditional lexical analysis
  2803. =================================
  2804. The traditional preprocessor does not decompose its input into tokens
  2805. the same way a standards-conforming preprocessor does. The input is
  2806. simply treated as a stream of text with minimal internal form.
  2807. This implementation does not treat trigraphs (*note trigraphs::)
  2808. specially since they were an invention of the standards committee. It
  2809. handles arbitrarily-positioned escaped newlines properly and splices the
  2810. lines as you would expect; many traditional preprocessors did not do
  2811. this.
  2812. The form of horizontal whitespace in the input file is preserved in
  2813. the output. In particular, hard tabs remain hard tabs. This can be
  2814. useful if, for example, you are preprocessing a Makefile.
  2815. Traditional CPP only recognizes C-style block comments, and treats
  2816. the '/*' sequence as introducing a comment only if it lies outside
  2817. quoted text. Quoted text is introduced by the usual single and double
  2818. quotes, and also by an initial '<' in a '#include' directive.
  2819. Traditionally, comments are completely removed and are not replaced
  2820. with a space. Since a traditional compiler does its own tokenization of
  2821. the output of the preprocessor, this means that comments can effectively
  2822. be used as token paste operators. However, comments behave like
  2823. separators for text handled by the preprocessor itself, since it doesn't
  2824. re-lex its input. For example, in
  2825. #if foo/**/bar
  2826. 'foo' and 'bar' are distinct identifiers and expanded separately if they
  2827. happen to be macros. In other words, this directive is equivalent to
  2828. #if foo bar
  2829. rather than
  2830. #if foobar
  2831. Generally speaking, in traditional mode an opening quote need not
  2832. have a matching closing quote. In particular, a macro may be defined
  2833. with replacement text that contains an unmatched quote. Of course, if
  2834. you attempt to compile preprocessed output containing an unmatched quote
  2835. you will get a syntax error.
  2836. However, all preprocessing directives other than '#define' require
  2837. matching quotes. For example:
  2838. #define m This macro's fine and has an unmatched quote
  2839. "/* This is not a comment. */
  2840. /* This is a comment. The following #include directive
  2841. is ill-formed. */
  2842. #include <stdio.h
  2843. Just as for the ISO preprocessor, what would be a closing quote can
  2844. be escaped with a backslash to prevent the quoted text from closing.
  2845. 
  2846. File: x86_64-linux-gnu-cpp.info, Node: Traditional macros, Next: Traditional miscellany, Prev: Traditional lexical analysis, Up: Traditional Mode
  2847. 10.2 Traditional macros
  2848. =======================
  2849. The major difference between traditional and ISO macros is that the
  2850. former expand to text rather than to a token sequence. CPP removes all
  2851. leading and trailing horizontal whitespace from a macro's replacement
  2852. text before storing it, but preserves the form of internal whitespace.
  2853. One consequence is that it is legitimate for the replacement text to
  2854. contain an unmatched quote (*note Traditional lexical analysis::). An
  2855. unclosed string or character constant continues into the text following
  2856. the macro call. Similarly, the text at the end of a macro's expansion
  2857. can run together with the text after the macro invocation to produce a
  2858. single token.
  2859. Normally comments are removed from the replacement text after the
  2860. macro is expanded, but if the '-CC' option is passed on the command-line
  2861. comments are preserved. (In fact, the current implementation removes
  2862. comments even before saving the macro replacement text, but it careful
  2863. to do it in such a way that the observed effect is identical even in the
  2864. function-like macro case.)
  2865. The ISO stringizing operator '#' and token paste operator '##' have
  2866. no special meaning. As explained later, an effect similar to these
  2867. operators can be obtained in a different way. Macro names that are
  2868. embedded in quotes, either from the main file or after macro
  2869. replacement, do not expand.
  2870. CPP replaces an unquoted object-like macro name with its replacement
  2871. text, and then rescans it for further macros to replace. Unlike
  2872. standard macro expansion, traditional macro expansion has no provision
  2873. to prevent recursion. If an object-like macro appears unquoted in its
  2874. replacement text, it will be replaced again during the rescan pass, and
  2875. so on _ad infinitum_. GCC detects when it is expanding recursive
  2876. macros, emits an error message, and continues after the offending macro
  2877. invocation.
  2878. #define PLUS +
  2879. #define INC(x) PLUS+x
  2880. INC(foo);
  2881. ==> ++foo;
  2882. Function-like macros are similar in form but quite different in
  2883. behavior to their ISO counterparts. Their arguments are contained
  2884. within parentheses, are comma-separated, and can cross physical lines.
  2885. Commas within nested parentheses are not treated as argument separators.
  2886. Similarly, a quote in an argument cannot be left unclosed; a following
  2887. comma or parenthesis that comes before the closing quote is treated like
  2888. any other character. There is no facility for handling variadic macros.
  2889. This implementation removes all comments from macro arguments, unless
  2890. the '-C' option is given. The form of all other horizontal whitespace
  2891. in arguments is preserved, including leading and trailing whitespace.
  2892. In particular
  2893. f( )
  2894. is treated as an invocation of the macro 'f' with a single argument
  2895. consisting of a single space. If you want to invoke a function-like
  2896. macro that takes no arguments, you must not leave any whitespace between
  2897. the parentheses.
  2898. If a macro argument crosses a new line, the new line is replaced with
  2899. a space when forming the argument. If the previous line contained an
  2900. unterminated quote, the following line inherits the quoted state.
  2901. Traditional preprocessors replace parameters in the replacement text
  2902. with their arguments regardless of whether the parameters are within
  2903. quotes or not. This provides a way to stringize arguments. For example
  2904. #define str(x) "x"
  2905. str(/* A comment */some text )
  2906. ==> "some text "
  2907. Note that the comment is removed, but that the trailing space is
  2908. preserved. Here is an example of using a comment to effect token
  2909. pasting.
  2910. #define suffix(x) foo_/**/x
  2911. suffix(bar)
  2912. ==> foo_bar
  2913. 
  2914. File: x86_64-linux-gnu-cpp.info, Node: Traditional miscellany, Next: Traditional warnings, Prev: Traditional macros, Up: Traditional Mode
  2915. 10.3 Traditional miscellany
  2916. ===========================
  2917. Here are some things to be aware of when using the traditional
  2918. preprocessor.
  2919. * Preprocessing directives are recognized only when their leading '#'
  2920. appears in the first column. There can be no whitespace between
  2921. the beginning of the line and the '#', but whitespace can follow
  2922. the '#'.
  2923. * A true traditional C preprocessor does not recognize '#error' or
  2924. '#pragma', and may not recognize '#elif'. CPP supports all the
  2925. directives in traditional mode that it supports in ISO mode,
  2926. including extensions, with the exception that the effects of
  2927. '#pragma GCC poison' are undefined.
  2928. * __STDC__ is not defined.
  2929. * If you use digraphs the behavior is undefined.
  2930. * If a line that looks like a directive appears within macro
  2931. arguments, the behavior is undefined.
  2932. 
  2933. File: x86_64-linux-gnu-cpp.info, Node: Traditional warnings, Prev: Traditional miscellany, Up: Traditional Mode
  2934. 10.4 Traditional warnings
  2935. =========================
  2936. You can request warnings about features that did not exist, or worked
  2937. differently, in traditional C with the '-Wtraditional' option. GCC does
  2938. not warn about features of ISO C which you must use when you are using a
  2939. conforming compiler, such as the '#' and '##' operators.
  2940. Presently '-Wtraditional' warns about:
  2941. * Macro parameters that appear within string literals in the macro
  2942. body. In traditional C macro replacement takes place within string
  2943. literals, but does not in ISO C.
  2944. * In traditional C, some preprocessor directives did not exist.
  2945. Traditional preprocessors would only consider a line to be a
  2946. directive if the '#' appeared in column 1 on the line. Therefore
  2947. '-Wtraditional' warns about directives that traditional C
  2948. understands but would ignore because the '#' does not appear as the
  2949. first character on the line. It also suggests you hide directives
  2950. like '#pragma' not understood by traditional C by indenting them.
  2951. Some traditional implementations would not recognize '#elif', so it
  2952. suggests avoiding it altogether.
  2953. * A function-like macro that appears without an argument list. In
  2954. some traditional preprocessors this was an error. In ISO C it
  2955. merely means that the macro is not expanded.
  2956. * The unary plus operator. This did not exist in traditional C.
  2957. * The 'U' and 'LL' integer constant suffixes, which were not
  2958. available in traditional C. (Traditional C does support the 'L'
  2959. suffix for simple long integer constants.) You are not warned
  2960. about uses of these suffixes in macros defined in system headers.
  2961. For instance, 'UINT_MAX' may well be defined as '4294967295U', but
  2962. you will not be warned if you use 'UINT_MAX'.
  2963. You can usually avoid the warning, and the related warning about
  2964. constants which are so large that they are unsigned, by writing the
  2965. integer constant in question in hexadecimal, with no U suffix.
  2966. Take care, though, because this gives the wrong result in exotic
  2967. cases.
  2968. 
  2969. File: x86_64-linux-gnu-cpp.info, Node: Implementation Details, Next: Invocation, Prev: Traditional Mode, Up: Top
  2970. 11 Implementation Details
  2971. *************************
  2972. Here we document details of how the preprocessor's implementation
  2973. affects its user-visible behavior. You should try to avoid undue
  2974. reliance on behavior described here, as it is possible that it will
  2975. change subtly in future implementations.
  2976. Also documented here are obsolete features still supported by CPP.
  2977. * Menu:
  2978. * Implementation-defined behavior::
  2979. * Implementation limits::
  2980. * Obsolete Features::
  2981. 
  2982. File: x86_64-linux-gnu-cpp.info, Node: Implementation-defined behavior, Next: Implementation limits, Up: Implementation Details
  2983. 11.1 Implementation-defined behavior
  2984. ====================================
  2985. This is how CPP behaves in all the cases which the C standard describes
  2986. as "implementation-defined". This term means that the implementation is
  2987. free to do what it likes, but must document its choice and stick to it.
  2988. * The mapping of physical source file multi-byte characters to the
  2989. execution character set.
  2990. The input character set can be specified using the
  2991. '-finput-charset' option, while the execution character set may be
  2992. controlled using the '-fexec-charset' and '-fwide-exec-charset'
  2993. options.
  2994. * Identifier characters.
  2995. The C and C++ standards allow identifiers to be composed of '_' and
  2996. the alphanumeric characters. C++ also allows universal character
  2997. names. C99 and later C standards permit both universal character
  2998. names and implementation-defined characters.
  2999. GCC allows the '$' character in identifiers as an extension for
  3000. most targets. This is true regardless of the 'std=' switch, since
  3001. this extension cannot conflict with standards-conforming programs.
  3002. When preprocessing assembler, however, dollars are not identifier
  3003. characters by default.
  3004. Currently the targets that by default do not permit '$' are AVR,
  3005. IP2K, MMIX, MIPS Irix 3, ARM aout, and PowerPC targets for the AIX
  3006. operating system.
  3007. You can override the default with '-fdollars-in-identifiers' or
  3008. 'fno-dollars-in-identifiers'. *Note fdollars-in-identifiers::.
  3009. * Non-empty sequences of whitespace characters.
  3010. In textual output, each whitespace sequence is collapsed to a
  3011. single space. For aesthetic reasons, the first token on each
  3012. non-directive line of output is preceded with sufficient spaces
  3013. that it appears in the same column as it did in the original source
  3014. file.
  3015. * The numeric value of character constants in preprocessor
  3016. expressions.
  3017. The preprocessor and compiler interpret character constants in the
  3018. same way; i.e. escape sequences such as '\a' are given the values
  3019. they would have on the target machine.
  3020. The compiler evaluates a multi-character character constant a
  3021. character at a time, shifting the previous value left by the number
  3022. of bits per target character, and then or-ing in the bit-pattern of
  3023. the new character truncated to the width of a target character.
  3024. The final bit-pattern is given type 'int', and is therefore signed,
  3025. regardless of whether single characters are signed or not. If
  3026. there are more characters in the constant than would fit in the
  3027. target 'int' the compiler issues a warning, and the excess leading
  3028. characters are ignored.
  3029. For example, ''ab'' for a target with an 8-bit 'char' would be
  3030. interpreted as
  3031. '(int) ((unsigned char) 'a' * 256 + (unsigned char) 'b')', and
  3032. ''\234a'' as
  3033. '(int) ((unsigned char) '\234' * 256 + (unsigned char) 'a')'.
  3034. * Source file inclusion.
  3035. For a discussion on how the preprocessor locates header files,
  3036. *note Include Operation::.
  3037. * Interpretation of the filename resulting from a macro-expanded
  3038. '#include' directive.
  3039. *Note Computed Includes::.
  3040. * Treatment of a '#pragma' directive that after macro-expansion
  3041. results in a standard pragma.
  3042. No macro expansion occurs on any '#pragma' directive line, so the
  3043. question does not arise.
  3044. Note that GCC does not yet implement any of the standard pragmas.
  3045. 
  3046. File: x86_64-linux-gnu-cpp.info, Node: Implementation limits, Next: Obsolete Features, Prev: Implementation-defined behavior, Up: Implementation Details
  3047. 11.2 Implementation limits
  3048. ==========================
  3049. CPP has a small number of internal limits. This section lists the
  3050. limits which the C standard requires to be no lower than some minimum,
  3051. and all the others known. It is intended that there should be as few
  3052. limits as possible. If you encounter an undocumented or inconvenient
  3053. limit, please report that as a bug. *Note Reporting Bugs: (gcc)Bugs.
  3054. Where we say something is limited "only by available memory", that
  3055. means that internal data structures impose no intrinsic limit, and space
  3056. is allocated with 'malloc' or equivalent. The actual limit will
  3057. therefore depend on many things, such as the size of other things
  3058. allocated by the compiler at the same time, the amount of memory
  3059. consumed by other processes on the same computer, etc.
  3060. * Nesting levels of '#include' files.
  3061. We impose an arbitrary limit of 200 levels, to avoid runaway
  3062. recursion. The standard requires at least 15 levels.
  3063. * Nesting levels of conditional inclusion.
  3064. The C standard mandates this be at least 63. CPP is limited only
  3065. by available memory.
  3066. * Levels of parenthesized expressions within a full expression.
  3067. The C standard requires this to be at least 63. In preprocessor
  3068. conditional expressions, it is limited only by available memory.
  3069. * Significant initial characters in an identifier or macro name.
  3070. The preprocessor treats all characters as significant. The C
  3071. standard requires only that the first 63 be significant.
  3072. * Number of macros simultaneously defined in a single translation
  3073. unit.
  3074. The standard requires at least 4095 be possible. CPP is limited
  3075. only by available memory.
  3076. * Number of parameters in a macro definition and arguments in a macro
  3077. call.
  3078. We allow 'USHRT_MAX', which is no smaller than 65,535. The minimum
  3079. required by the standard is 127.
  3080. * Number of characters on a logical source line.
  3081. The C standard requires a minimum of 4096 be permitted. CPP places
  3082. no limits on this, but you may get incorrect column numbers
  3083. reported in diagnostics for lines longer than 65,535 characters.
  3084. * Maximum size of a source file.
  3085. The standard does not specify any lower limit on the maximum size
  3086. of a source file. GNU cpp maps files into memory, so it is limited
  3087. by the available address space. This is generally at least two
  3088. gigabytes. Depending on the operating system, the size of physical
  3089. memory may or may not be a limitation.
  3090. 
  3091. File: x86_64-linux-gnu-cpp.info, Node: Obsolete Features, Prev: Implementation limits, Up: Implementation Details
  3092. 11.3 Obsolete Features
  3093. ======================
  3094. CPP has some features which are present mainly for compatibility with
  3095. older programs. We discourage their use in new code. In some cases, we
  3096. plan to remove the feature in a future version of GCC.
  3097. 11.3.1 Assertions
  3098. -----------------
  3099. "Assertions" are a deprecated alternative to macros in writing
  3100. conditionals to test what sort of computer or system the compiled
  3101. program will run on. Assertions are usually predefined, but you can
  3102. define them with preprocessing directives or command-line options.
  3103. Assertions were intended to provide a more systematic way to describe
  3104. the compiler's target system and we added them for compatibility with
  3105. existing compilers. In practice they are just as unpredictable as the
  3106. system-specific predefined macros. In addition, they are not part of
  3107. any standard, and only a few compilers support them. Therefore, the use
  3108. of assertions is *less* portable than the use of system-specific
  3109. predefined macros. We recommend you do not use them at all.
  3110. An assertion looks like this:
  3111. #PREDICATE (ANSWER)
  3112. PREDICATE must be a single identifier. ANSWER can be any sequence of
  3113. tokens; all characters are significant except for leading and trailing
  3114. whitespace, and differences in internal whitespace sequences are
  3115. ignored. (This is similar to the rules governing macro redefinition.)
  3116. Thus, '(x + y)' is different from '(x+y)' but equivalent to '( x + y )'.
  3117. Parentheses do not nest inside an answer.
  3118. To test an assertion, you write it in an '#if'. For example, this
  3119. conditional succeeds if either 'vax' or 'ns16000' has been asserted as
  3120. an answer for 'machine'.
  3121. #if #machine (vax) || #machine (ns16000)
  3122. You can test whether _any_ answer is asserted for a predicate by
  3123. omitting the answer in the conditional:
  3124. #if #machine
  3125. Assertions are made with the '#assert' directive. Its sole argument
  3126. is the assertion to make, without the leading '#' that identifies
  3127. assertions in conditionals.
  3128. #assert PREDICATE (ANSWER)
  3129. You may make several assertions with the same predicate and different
  3130. answers. Subsequent assertions do not override previous ones for the
  3131. same predicate. All the answers for any given predicate are
  3132. simultaneously true.
  3133. Assertions can be canceled with the '#unassert' directive. It has
  3134. the same syntax as '#assert'. In that form it cancels only the answer
  3135. which was specified on the '#unassert' line; other answers for that
  3136. predicate remain true. You can cancel an entire predicate by leaving
  3137. out the answer:
  3138. #unassert PREDICATE
  3139. In either form, if no such assertion has been made, '#unassert' has no
  3140. effect.
  3141. You can also make or cancel assertions using command-line options.
  3142. *Note Invocation::.
  3143. 
  3144. File: x86_64-linux-gnu-cpp.info, Node: Invocation, Next: Environment Variables, Prev: Implementation Details, Up: Top
  3145. 12 Invocation
  3146. *************
  3147. Most often when you use the C preprocessor you do not have to invoke it
  3148. explicitly: the C compiler does so automatically. However, the
  3149. preprocessor is sometimes useful on its own. You can invoke the
  3150. preprocessor either with the 'cpp' command, or via 'gcc -E'. In GCC,
  3151. the preprocessor is actually integrated with the compiler rather than a
  3152. separate program, and both of these commands invoke GCC and tell it to
  3153. stop after the preprocessing phase.
  3154. The 'cpp' options listed here are also accepted by 'gcc' and have the
  3155. same meaning. Likewise the 'cpp' command accepts all the usual 'gcc'
  3156. driver options, although those pertaining to compilation phases after
  3157. preprocessing are ignored.
  3158. Only options specific to preprocessing behavior are documented here.
  3159. Refer to the GCC manual for full documentation of other driver options.
  3160. The 'cpp' command expects two file names as arguments, INFILE and
  3161. OUTFILE. The preprocessor reads INFILE together with any other files it
  3162. specifies with '#include'. All the output generated by the combined
  3163. input files is written in OUTFILE.
  3164. Either INFILE or OUTFILE may be '-', which as INFILE means to read
  3165. from standard input and as OUTFILE means to write to standard output.
  3166. If either file is omitted, it means the same as if '-' had been
  3167. specified for that file. You can also use the '-o OUTFILE' option to
  3168. specify the output file.
  3169. Unless otherwise noted, or the option ends in '=', all options which
  3170. take an argument may have that argument appear either immediately after
  3171. the option, or with a space between option and argument: '-Ifoo' and '-I
  3172. foo' have the same effect.
  3173. Many options have multi-letter names; therefore multiple
  3174. single-letter options may _not_ be grouped: '-dM' is very different from
  3175. '-d -M'.
  3176. '-D NAME'
  3177. Predefine NAME as a macro, with definition '1'.
  3178. '-D NAME=DEFINITION'
  3179. The contents of DEFINITION are tokenized and processed as if they
  3180. appeared during translation phase three in a '#define' directive.
  3181. In particular, the definition is truncated by embedded newline
  3182. characters.
  3183. If you are invoking the preprocessor from a shell or shell-like
  3184. program you may need to use the shell's quoting syntax to protect
  3185. characters such as spaces that have a meaning in the shell syntax.
  3186. If you wish to define a function-like macro on the command line,
  3187. write its argument list with surrounding parentheses before the
  3188. equals sign (if any). Parentheses are meaningful to most shells,
  3189. so you should quote the option. With 'sh' and 'csh',
  3190. '-D'NAME(ARGS...)=DEFINITION'' works.
  3191. '-D' and '-U' options are processed in the order they are given on
  3192. the command line. All '-imacros FILE' and '-include FILE' options
  3193. are processed after all '-D' and '-U' options.
  3194. '-U NAME'
  3195. Cancel any previous definition of NAME, either built in or provided
  3196. with a '-D' option.
  3197. '-include FILE'
  3198. Process FILE as if '#include "file"' appeared as the first line of
  3199. the primary source file. However, the first directory searched for
  3200. FILE is the preprocessor's working directory _instead of_ the
  3201. directory containing the main source file. If not found there, it
  3202. is searched for in the remainder of the '#include "..."' search
  3203. chain as normal.
  3204. If multiple '-include' options are given, the files are included in
  3205. the order they appear on the command line.
  3206. '-imacros FILE'
  3207. Exactly like '-include', except that any output produced by
  3208. scanning FILE is thrown away. Macros it defines remain defined.
  3209. This allows you to acquire all the macros from a header without
  3210. also processing its declarations.
  3211. All files specified by '-imacros' are processed before all files
  3212. specified by '-include'.
  3213. '-undef'
  3214. Do not predefine any system-specific or GCC-specific macros. The
  3215. standard predefined macros remain defined. *Note Standard
  3216. Predefined Macros::.
  3217. '-pthread'
  3218. Define additional macros required for using the POSIX threads
  3219. library. You should use this option consistently for both
  3220. compilation and linking. This option is supported on GNU/Linux
  3221. targets, most other Unix derivatives, and also on x86 Cygwin and
  3222. MinGW targets.
  3223. '-M'
  3224. Instead of outputting the result of preprocessing, output a rule
  3225. suitable for 'make' describing the dependencies of the main source
  3226. file. The preprocessor outputs one 'make' rule containing the
  3227. object file name for that source file, a colon, and the names of
  3228. all the included files, including those coming from '-include' or
  3229. '-imacros' command-line options.
  3230. Unless specified explicitly (with '-MT' or '-MQ'), the object file
  3231. name consists of the name of the source file with any suffix
  3232. replaced with object file suffix and with any leading directory
  3233. parts removed. If there are many included files then the rule is
  3234. split into several lines using '\'-newline. The rule has no
  3235. commands.
  3236. This option does not suppress the preprocessor's debug output, such
  3237. as '-dM'. To avoid mixing such debug output with the dependency
  3238. rules you should explicitly specify the dependency output file with
  3239. '-MF', or use an environment variable like 'DEPENDENCIES_OUTPUT'
  3240. (*note Environment Variables::). Debug output is still sent to the
  3241. regular output stream as normal.
  3242. Passing '-M' to the driver implies '-E', and suppresses warnings
  3243. with an implicit '-w'.
  3244. '-MM'
  3245. Like '-M' but do not mention header files that are found in system
  3246. header directories, nor header files that are included, directly or
  3247. indirectly, from such a header.
  3248. This implies that the choice of angle brackets or double quotes in
  3249. an '#include' directive does not in itself determine whether that
  3250. header appears in '-MM' dependency output.
  3251. '-MF FILE'
  3252. When used with '-M' or '-MM', specifies a file to write the
  3253. dependencies to. If no '-MF' switch is given the preprocessor
  3254. sends the rules to the same place it would send preprocessed
  3255. output.
  3256. When used with the driver options '-MD' or '-MMD', '-MF' overrides
  3257. the default dependency output file.
  3258. If FILE is '-', then the dependencies are written to 'stdout'.
  3259. '-MG'
  3260. In conjunction with an option such as '-M' requesting dependency
  3261. generation, '-MG' assumes missing header files are generated files
  3262. and adds them to the dependency list without raising an error. The
  3263. dependency filename is taken directly from the '#include' directive
  3264. without prepending any path. '-MG' also suppresses preprocessed
  3265. output, as a missing header file renders this useless.
  3266. This feature is used in automatic updating of makefiles.
  3267. '-MP'
  3268. This option instructs CPP to add a phony target for each dependency
  3269. other than the main file, causing each to depend on nothing. These
  3270. dummy rules work around errors 'make' gives if you remove header
  3271. files without updating the 'Makefile' to match.
  3272. This is typical output:
  3273. test.o: test.c test.h
  3274. test.h:
  3275. '-MT TARGET'
  3276. Change the target of the rule emitted by dependency generation. By
  3277. default CPP takes the name of the main input file, deletes any
  3278. directory components and any file suffix such as '.c', and appends
  3279. the platform's usual object suffix. The result is the target.
  3280. An '-MT' option sets the target to be exactly the string you
  3281. specify. If you want multiple targets, you can specify them as a
  3282. single argument to '-MT', or use multiple '-MT' options.
  3283. For example, '-MT '$(objpfx)foo.o'' might give
  3284. $(objpfx)foo.o: foo.c
  3285. '-MQ TARGET'
  3286. Same as '-MT', but it quotes any characters which are special to
  3287. Make. '-MQ '$(objpfx)foo.o'' gives
  3288. $$(objpfx)foo.o: foo.c
  3289. The default target is automatically quoted, as if it were given
  3290. with '-MQ'.
  3291. '-MD'
  3292. '-MD' is equivalent to '-M -MF FILE', except that '-E' is not
  3293. implied. The driver determines FILE based on whether an '-o'
  3294. option is given. If it is, the driver uses its argument but with a
  3295. suffix of '.d', otherwise it takes the name of the input file,
  3296. removes any directory components and suffix, and applies a '.d'
  3297. suffix.
  3298. If '-MD' is used in conjunction with '-E', any '-o' switch is
  3299. understood to specify the dependency output file (*note -MF:
  3300. dashMF.), but if used without '-E', each '-o' is understood to
  3301. specify a target object file.
  3302. Since '-E' is not implied, '-MD' can be used to generate a
  3303. dependency output file as a side effect of the compilation process.
  3304. '-MMD'
  3305. Like '-MD' except mention only user header files, not system header
  3306. files.
  3307. '-fpreprocessed'
  3308. Indicate to the preprocessor that the input file has already been
  3309. preprocessed. This suppresses things like macro expansion,
  3310. trigraph conversion, escaped newline splicing, and processing of
  3311. most directives. The preprocessor still recognizes and removes
  3312. comments, so that you can pass a file preprocessed with '-C' to the
  3313. compiler without problems. In this mode the integrated
  3314. preprocessor is little more than a tokenizer for the front ends.
  3315. '-fpreprocessed' is implicit if the input file has one of the
  3316. extensions '.i', '.ii' or '.mi'. These are the extensions that GCC
  3317. uses for preprocessed files created by '-save-temps'.
  3318. '-fdirectives-only'
  3319. When preprocessing, handle directives, but do not expand macros.
  3320. The option's behavior depends on the '-E' and '-fpreprocessed'
  3321. options.
  3322. With '-E', preprocessing is limited to the handling of directives
  3323. such as '#define', '#ifdef', and '#error'. Other preprocessor
  3324. operations, such as macro expansion and trigraph conversion are not
  3325. performed. In addition, the '-dD' option is implicitly enabled.
  3326. With '-fpreprocessed', predefinition of command line and most
  3327. builtin macros is disabled. Macros such as '__LINE__', which are
  3328. contextually dependent, are handled normally. This enables
  3329. compilation of files previously preprocessed with '-E
  3330. -fdirectives-only'.
  3331. With both '-E' and '-fpreprocessed', the rules for '-fpreprocessed'
  3332. take precedence. This enables full preprocessing of files
  3333. previously preprocessed with '-E -fdirectives-only'.
  3334. '-fdollars-in-identifiers'
  3335. Accept '$' in identifiers. *Note Identifier characters::.
  3336. '-fextended-identifiers'
  3337. Accept universal character names in identifiers. This option is
  3338. enabled by default for C99 (and later C standard versions) and C++.
  3339. '-fno-canonical-system-headers'
  3340. When preprocessing, do not shorten system header paths with
  3341. canonicalization.
  3342. '-ftabstop=WIDTH'
  3343. Set the distance between tab stops. This helps the preprocessor
  3344. report correct column numbers in warnings or errors, even if tabs
  3345. appear on the line. If the value is less than 1 or greater than
  3346. 100, the option is ignored. The default is 8.
  3347. '-ftrack-macro-expansion[=LEVEL]'
  3348. Track locations of tokens across macro expansions. This allows the
  3349. compiler to emit diagnostic about the current macro expansion stack
  3350. when a compilation error occurs in a macro expansion. Using this
  3351. option makes the preprocessor and the compiler consume more memory.
  3352. The LEVEL parameter can be used to choose the level of precision of
  3353. token location tracking thus decreasing the memory consumption if
  3354. necessary. Value '0' of LEVEL de-activates this option. Value '1'
  3355. tracks tokens locations in a degraded mode for the sake of minimal
  3356. memory overhead. In this mode all tokens resulting from the
  3357. expansion of an argument of a function-like macro have the same
  3358. location. Value '2' tracks tokens locations completely. This
  3359. value is the most memory hungry. When this option is given no
  3360. argument, the default parameter value is '2'.
  3361. Note that '-ftrack-macro-expansion=2' is activated by default.
  3362. '-fmacro-prefix-map=OLD=NEW'
  3363. When preprocessing files residing in directory 'OLD', expand the
  3364. '__FILE__' and '__BASE_FILE__' macros as if the files resided in
  3365. directory 'NEW' instead. This can be used to change an absolute
  3366. path to a relative path by using '.' for NEW which can result in
  3367. more reproducible builds that are location independent. This
  3368. option also affects '__builtin_FILE()' during compilation. See
  3369. also '-ffile-prefix-map'.
  3370. '-fexec-charset=CHARSET'
  3371. Set the execution character set, used for string and character
  3372. constants. The default is UTF-8. CHARSET can be any encoding
  3373. supported by the system's 'iconv' library routine.
  3374. '-fwide-exec-charset=CHARSET'
  3375. Set the wide execution character set, used for wide string and
  3376. character constants. The default is UTF-32 or UTF-16, whichever
  3377. corresponds to the width of 'wchar_t'. As with '-fexec-charset',
  3378. CHARSET can be any encoding supported by the system's 'iconv'
  3379. library routine; however, you will have problems with encodings
  3380. that do not fit exactly in 'wchar_t'.
  3381. '-finput-charset=CHARSET'
  3382. Set the input character set, used for translation from the
  3383. character set of the input file to the source character set used by
  3384. GCC. If the locale does not specify, or GCC cannot get this
  3385. information from the locale, the default is UTF-8. This can be
  3386. overridden by either the locale or this command-line option.
  3387. Currently the command-line option takes precedence if there's a
  3388. conflict. CHARSET can be any encoding supported by the system's
  3389. 'iconv' library routine.
  3390. '-fworking-directory'
  3391. Enable generation of linemarkers in the preprocessor output that
  3392. let the compiler know the current working directory at the time of
  3393. preprocessing. When this option is enabled, the preprocessor
  3394. emits, after the initial linemarker, a second linemarker with the
  3395. current working directory followed by two slashes. GCC uses this
  3396. directory, when it's present in the preprocessed input, as the
  3397. directory emitted as the current working directory in some
  3398. debugging information formats. This option is implicitly enabled
  3399. if debugging information is enabled, but this can be inhibited with
  3400. the negated form '-fno-working-directory'. If the '-P' flag is
  3401. present in the command line, this option has no effect, since no
  3402. '#line' directives are emitted whatsoever.
  3403. '-A PREDICATE=ANSWER'
  3404. Make an assertion with the predicate PREDICATE and answer ANSWER.
  3405. This form is preferred to the older form '-A PREDICATE(ANSWER)',
  3406. which is still supported, because it does not use shell special
  3407. characters. *Note Obsolete Features::.
  3408. '-A -PREDICATE=ANSWER'
  3409. Cancel an assertion with the predicate PREDICATE and answer ANSWER.
  3410. '-C'
  3411. Do not discard comments. All comments are passed through to the
  3412. output file, except for comments in processed directives, which are
  3413. deleted along with the directive.
  3414. You should be prepared for side effects when using '-C'; it causes
  3415. the preprocessor to treat comments as tokens in their own right.
  3416. For example, comments appearing at the start of what would be a
  3417. directive line have the effect of turning that line into an
  3418. ordinary source line, since the first token on the line is no
  3419. longer a '#'.
  3420. '-CC'
  3421. Do not discard comments, including during macro expansion. This is
  3422. like '-C', except that comments contained within macros are also
  3423. passed through to the output file where the macro is expanded.
  3424. In addition to the side effects of the '-C' option, the '-CC'
  3425. option causes all C++-style comments inside a macro to be converted
  3426. to C-style comments. This is to prevent later use of that macro
  3427. from inadvertently commenting out the remainder of the source line.
  3428. The '-CC' option is generally used to support lint comments.
  3429. '-P'
  3430. Inhibit generation of linemarkers in the output from the
  3431. preprocessor. This might be useful when running the preprocessor
  3432. on something that is not C code, and will be sent to a program
  3433. which might be confused by the linemarkers. *Note Preprocessor
  3434. Output::.
  3435. '-traditional'
  3436. '-traditional-cpp'
  3437. Try to imitate the behavior of pre-standard C preprocessors, as
  3438. opposed to ISO C preprocessors. *Note Traditional Mode::.
  3439. Note that GCC does not otherwise attempt to emulate a pre-standard
  3440. C compiler, and these options are only supported with the '-E'
  3441. switch, or when invoking CPP explicitly.
  3442. '-trigraphs'
  3443. Support ISO C trigraphs. These are three-character sequences, all
  3444. starting with '??', that are defined by ISO C to stand for single
  3445. characters. For example, '??/' stands for '\', so ''??/n'' is a
  3446. character constant for a newline. *Note Initial processing::.
  3447. By default, GCC ignores trigraphs, but in standard-conforming modes
  3448. it converts them. See the '-std' and '-ansi' options.
  3449. '-remap'
  3450. Enable special code to work around file systems which only permit
  3451. very short file names, such as MS-DOS.
  3452. '-H'
  3453. Print the name of each header file used, in addition to other
  3454. normal activities. Each name is indented to show how deep in the
  3455. '#include' stack it is. Precompiled header files are also printed,
  3456. even if they are found to be invalid; an invalid precompiled header
  3457. file is printed with '...x' and a valid one with '...!' .
  3458. '-dLETTERS'
  3459. Says to make debugging dumps during compilation as specified by
  3460. LETTERS. The flags documented here are those relevant to the
  3461. preprocessor. Other LETTERS are interpreted by the compiler
  3462. proper, or reserved for future versions of GCC, and so are silently
  3463. ignored. If you specify LETTERS whose behavior conflicts, the
  3464. result is undefined.
  3465. '-dM'
  3466. Instead of the normal output, generate a list of '#define'
  3467. directives for all the macros defined during the execution of
  3468. the preprocessor, including predefined macros. This gives you
  3469. a way of finding out what is predefined in your version of the
  3470. preprocessor. Assuming you have no file 'foo.h', the command
  3471. touch foo.h; cpp -dM foo.h
  3472. shows all the predefined macros.
  3473. '-dD'
  3474. Like '-dM' except in two respects: it does _not_ include the
  3475. predefined macros, and it outputs _both_ the '#define'
  3476. directives and the result of preprocessing. Both kinds of
  3477. output go to the standard output file.
  3478. '-dN'
  3479. Like '-dD', but emit only the macro names, not their
  3480. expansions.
  3481. '-dI'
  3482. Output '#include' directives in addition to the result of
  3483. preprocessing.
  3484. '-dU'
  3485. Like '-dD' except that only macros that are expanded, or whose
  3486. definedness is tested in preprocessor directives, are output;
  3487. the output is delayed until the use or test of the macro; and
  3488. '#undef' directives are also output for macros tested but
  3489. undefined at the time.
  3490. '-fdebug-cpp'
  3491. This option is only useful for debugging GCC. When used from CPP or
  3492. with '-E', it dumps debugging information about location maps.
  3493. Every token in the output is preceded by the dump of the map its
  3494. location belongs to.
  3495. When used from GCC without '-E', this option has no effect.
  3496. '-I DIR'
  3497. '-iquote DIR'
  3498. '-isystem DIR'
  3499. '-idirafter DIR'
  3500. Add the directory DIR to the list of directories to be searched for
  3501. header files during preprocessing. *Note Search Path::. If DIR
  3502. begins with '=' or '$SYSROOT', then the '=' or '$SYSROOT' is
  3503. replaced by the sysroot prefix; see '--sysroot' and '-isysroot'.
  3504. Directories specified with '-iquote' apply only to the quote form
  3505. of the directive, '#include "FILE"'. Directories specified with
  3506. '-I', '-isystem', or '-idirafter' apply to lookup for both the
  3507. '#include "FILE"' and '#include <FILE>' directives.
  3508. You can specify any number or combination of these options on the
  3509. command line to search for header files in several directories.
  3510. The lookup order is as follows:
  3511. 1. For the quote form of the include directive, the directory of
  3512. the current file is searched first.
  3513. 2. For the quote form of the include directive, the directories
  3514. specified by '-iquote' options are searched in left-to-right
  3515. order, as they appear on the command line.
  3516. 3. Directories specified with '-I' options are scanned in
  3517. left-to-right order.
  3518. 4. Directories specified with '-isystem' options are scanned in
  3519. left-to-right order.
  3520. 5. Standard system directories are scanned.
  3521. 6. Directories specified with '-idirafter' options are scanned in
  3522. left-to-right order.
  3523. You can use '-I' to override a system header file, substituting
  3524. your own version, since these directories are searched before the
  3525. standard system header file directories. However, you should not
  3526. use this option to add directories that contain vendor-supplied
  3527. system header files; use '-isystem' for that.
  3528. The '-isystem' and '-idirafter' options also mark the directory as
  3529. a system directory, so that it gets the same special treatment that
  3530. is applied to the standard system directories. *Note System
  3531. Headers::.
  3532. If a standard system include directory, or a directory specified
  3533. with '-isystem', is also specified with '-I', the '-I' option is
  3534. ignored. The directory is still searched but as a system directory
  3535. at its normal position in the system include chain. This is to
  3536. ensure that GCC's procedure to fix buggy system headers and the
  3537. ordering for the '#include_next' directive are not inadvertently
  3538. changed. If you really need to change the search order for system
  3539. directories, use the '-nostdinc' and/or '-isystem' options. *Note
  3540. System Headers::.
  3541. '-I-'
  3542. Split the include path. This option has been deprecated. Please
  3543. use '-iquote' instead for '-I' directories before the '-I-' and
  3544. remove the '-I-' option.
  3545. Any directories specified with '-I' options before '-I-' are
  3546. searched only for headers requested with '#include "FILE"'; they
  3547. are not searched for '#include <FILE>'. If additional directories
  3548. are specified with '-I' options after the '-I-', those directories
  3549. are searched for all '#include' directives.
  3550. In addition, '-I-' inhibits the use of the directory of the current
  3551. file directory as the first search directory for '#include "FILE"'.
  3552. There is no way to override this effect of '-I-'. *Note Search
  3553. Path::.
  3554. '-iprefix PREFIX'
  3555. Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
  3556. If the prefix represents a directory, you should include the final
  3557. '/'.
  3558. '-iwithprefix DIR'
  3559. '-iwithprefixbefore DIR'
  3560. Append DIR to the prefix specified previously with '-iprefix', and
  3561. add the resulting directory to the include search path.
  3562. '-iwithprefixbefore' puts it in the same place '-I' would;
  3563. '-iwithprefix' puts it where '-idirafter' would.
  3564. '-isysroot DIR'
  3565. This option is like the '--sysroot' option, but applies only to
  3566. header files (except for Darwin targets, where it applies to both
  3567. header files and libraries). See the '--sysroot' option for more
  3568. information.
  3569. '-imultilib DIR'
  3570. Use DIR as a subdirectory of the directory containing
  3571. target-specific C++ headers.
  3572. '-nostdinc'
  3573. Do not search the standard system directories for header files.
  3574. Only the directories explicitly specified with '-I', '-iquote',
  3575. '-isystem', and/or '-idirafter' options (and the directory of the
  3576. current file, if appropriate) are searched.
  3577. '-nostdinc++'
  3578. Do not search for header files in the C++-specific standard
  3579. directories, but do still search the other standard directories.
  3580. (This option is used when building the C++ library.)
  3581. '-Wcomment'
  3582. '-Wcomments'
  3583. Warn whenever a comment-start sequence '/*' appears in a '/*'
  3584. comment, or whenever a backslash-newline appears in a '//' comment.
  3585. This warning is enabled by '-Wall'.
  3586. '-Wtrigraphs'
  3587. Warn if any trigraphs are encountered that might change the meaning
  3588. of the program. Trigraphs within comments are not warned about,
  3589. except those that would form escaped newlines.
  3590. This option is implied by '-Wall'. If '-Wall' is not given, this
  3591. option is still enabled unless trigraphs are enabled. To get
  3592. trigraph conversion without warnings, but get the other '-Wall'
  3593. warnings, use '-trigraphs -Wall -Wno-trigraphs'.
  3594. '-Wundef'
  3595. Warn if an undefined identifier is evaluated in an '#if' directive.
  3596. Such identifiers are replaced with zero.
  3597. '-Wexpansion-to-defined'
  3598. Warn whenever 'defined' is encountered in the expansion of a macro
  3599. (including the case where the macro is expanded by an '#if'
  3600. directive). Such usage is not portable. This warning is also
  3601. enabled by '-Wpedantic' and '-Wextra'.
  3602. '-Wunused-macros'
  3603. Warn about macros defined in the main file that are unused. A
  3604. macro is "used" if it is expanded or tested for existence at least
  3605. once. The preprocessor also warns if the macro has not been used
  3606. at the time it is redefined or undefined.
  3607. Built-in macros, macros defined on the command line, and macros
  3608. defined in include files are not warned about.
  3609. _Note:_ If a macro is actually used, but only used in skipped
  3610. conditional blocks, then the preprocessor reports it as unused. To
  3611. avoid the warning in such a case, you might improve the scope of
  3612. the macro's definition by, for example, moving it into the first
  3613. skipped block. Alternatively, you could provide a dummy use with
  3614. something like:
  3615. #if defined the_macro_causing_the_warning
  3616. #endif
  3617. '-Wno-endif-labels'
  3618. Do not warn whenever an '#else' or an '#endif' are followed by
  3619. text. This sometimes happens in older programs with code of the
  3620. form
  3621. #if FOO
  3622. ...
  3623. #else FOO
  3624. ...
  3625. #endif FOO
  3626. The second and third 'FOO' should be in comments. This warning is
  3627. on by default.
  3628. 
  3629. File: x86_64-linux-gnu-cpp.info, Node: Environment Variables, Next: GNU Free Documentation License, Prev: Invocation, Up: Top
  3630. 13 Environment Variables
  3631. ************************
  3632. This section describes the environment variables that affect how CPP
  3633. operates. You can use them to specify directories or prefixes to use
  3634. when searching for include files, or to control dependency output.
  3635. Note that you can also specify places to search using options such as
  3636. '-I', and control dependency output with options like '-M' (*note
  3637. Invocation::). These take precedence over environment variables, which
  3638. in turn take precedence over the configuration of GCC.
  3639. 'CPATH'
  3640. 'C_INCLUDE_PATH'
  3641. 'CPLUS_INCLUDE_PATH'
  3642. 'OBJC_INCLUDE_PATH'
  3643. Each variable's value is a list of directories separated by a
  3644. special character, much like 'PATH', in which to look for header
  3645. files. The special character, 'PATH_SEPARATOR', is
  3646. target-dependent and determined at GCC build time. For Microsoft
  3647. Windows-based targets it is a semicolon, and for almost all other
  3648. targets it is a colon.
  3649. 'CPATH' specifies a list of directories to be searched as if
  3650. specified with '-I', but after any paths given with '-I' options on
  3651. the command line. This environment variable is used regardless of
  3652. which language is being preprocessed.
  3653. The remaining environment variables apply only when preprocessing
  3654. the particular language indicated. Each specifies a list of
  3655. directories to be searched as if specified with '-isystem', but
  3656. after any paths given with '-isystem' options on the command line.
  3657. In all these variables, an empty element instructs the compiler to
  3658. search its current working directory. Empty elements can appear at
  3659. the beginning or end of a path. For instance, if the value of
  3660. 'CPATH' is ':/special/include', that has the same effect as
  3661. '-I. -I/special/include'.
  3662. See also *note Search Path::.
  3663. 'DEPENDENCIES_OUTPUT'
  3664. If this variable is set, its value specifies how to output
  3665. dependencies for Make based on the non-system header files
  3666. processed by the compiler. System header files are ignored in the
  3667. dependency output.
  3668. The value of 'DEPENDENCIES_OUTPUT' can be just a file name, in
  3669. which case the Make rules are written to that file, guessing the
  3670. target name from the source file name. Or the value can have the
  3671. form 'FILE TARGET', in which case the rules are written to file
  3672. FILE using TARGET as the target name.
  3673. In other words, this environment variable is equivalent to
  3674. combining the options '-MM' and '-MF' (*note Invocation::), with an
  3675. optional '-MT' switch too.
  3676. 'SUNPRO_DEPENDENCIES'
  3677. This variable is the same as 'DEPENDENCIES_OUTPUT' (see above),
  3678. except that system header files are not ignored, so it implies '-M'
  3679. rather than '-MM'. However, the dependence on the main input file
  3680. is omitted. *Note Invocation::.
  3681. 'SOURCE_DATE_EPOCH'
  3682. If this variable is set, its value specifies a UNIX timestamp to be
  3683. used in replacement of the current date and time in the '__DATE__'
  3684. and '__TIME__' macros, so that the embedded timestamps become
  3685. reproducible.
  3686. The value of 'SOURCE_DATE_EPOCH' must be a UNIX timestamp, defined
  3687. as the number of seconds (excluding leap seconds) since 01 Jan 1970
  3688. 00:00:00 represented in ASCII; identical to the output of ''date
  3689. +%s'' on GNU/Linux and other systems that support the '%s'
  3690. extension in the 'date' command.
  3691. The value should be a known timestamp such as the last modification
  3692. time of the source or package and it should be set by the build
  3693. process.
  3694. 
  3695. File: x86_64-linux-gnu-cpp.info, Node: GNU Free Documentation License, Next: Index of Directives, Prev: Environment Variables, Up: Top
  3696. GNU Free Documentation License
  3697. ******************************
  3698. Version 1.3, 3 November 2008
  3699. Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  3700. <http://fsf.org/>
  3701. Everyone is permitted to copy and distribute verbatim copies
  3702. of this license document, but changing it is not allowed.
  3703. 0. PREAMBLE
  3704. The purpose of this License is to make a manual, textbook, or other
  3705. functional and useful document "free" in the sense of freedom: to
  3706. assure everyone the effective freedom to copy and redistribute it,
  3707. with or without modifying it, either commercially or
  3708. noncommercially. Secondarily, this License preserves for the
  3709. author and publisher a way to get credit for their work, while not
  3710. being considered responsible for modifications made by others.
  3711. This License is a kind of "copyleft", which means that derivative
  3712. works of the document must themselves be free in the same sense.
  3713. It complements the GNU General Public License, which is a copyleft
  3714. license designed for free software.
  3715. We have designed this License in order to use it for manuals for
  3716. free software, because free software needs free documentation: a
  3717. free program should come with manuals providing the same freedoms
  3718. that the software does. But this License is not limited to
  3719. software manuals; it can be used for any textual work, regardless
  3720. of subject matter or whether it is published as a printed book. We
  3721. recommend this License principally for works whose purpose is
  3722. instruction or reference.
  3723. 1. APPLICABILITY AND DEFINITIONS
  3724. This License applies to any manual or other work, in any medium,
  3725. that contains a notice placed by the copyright holder saying it can
  3726. be distributed under the terms of this License. Such a notice
  3727. grants a world-wide, royalty-free license, unlimited in duration,
  3728. to use that work under the conditions stated herein. The
  3729. "Document", below, refers to any such manual or work. Any member
  3730. of the public is a licensee, and is addressed as "you". You accept
  3731. the license if you copy, modify or distribute the work in a way
  3732. requiring permission under copyright law.
  3733. A "Modified Version" of the Document means any work containing the
  3734. Document or a portion of it, either copied verbatim, or with
  3735. modifications and/or translated into another language.
  3736. A "Secondary Section" is a named appendix or a front-matter section
  3737. of the Document that deals exclusively with the relationship of the
  3738. publishers or authors of the Document to the Document's overall
  3739. subject (or to related matters) and contains nothing that could
  3740. fall directly within that overall subject. (Thus, if the Document
  3741. is in part a textbook of mathematics, a Secondary Section may not
  3742. explain any mathematics.) The relationship could be a matter of
  3743. historical connection with the subject or with related matters, or
  3744. of legal, commercial, philosophical, ethical or political position
  3745. regarding them.
  3746. The "Invariant Sections" are certain Secondary Sections whose
  3747. titles are designated, as being those of Invariant Sections, in the
  3748. notice that says that the Document is released under this License.
  3749. If a section does not fit the above definition of Secondary then it
  3750. is not allowed to be designated as Invariant. The Document may
  3751. contain zero Invariant Sections. If the Document does not identify
  3752. any Invariant Sections then there are none.
  3753. The "Cover Texts" are certain short passages of text that are
  3754. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  3755. that says that the Document is released under this License. A
  3756. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  3757. be at most 25 words.
  3758. A "Transparent" copy of the Document means a machine-readable copy,
  3759. represented in a format whose specification is available to the
  3760. general public, that is suitable for revising the document
  3761. straightforwardly with generic text editors or (for images composed
  3762. of pixels) generic paint programs or (for drawings) some widely
  3763. available drawing editor, and that is suitable for input to text
  3764. formatters or for automatic translation to a variety of formats
  3765. suitable for input to text formatters. A copy made in an otherwise
  3766. Transparent file format whose markup, or absence of markup, has
  3767. been arranged to thwart or discourage subsequent modification by
  3768. readers is not Transparent. An image format is not Transparent if
  3769. used for any substantial amount of text. A copy that is not
  3770. "Transparent" is called "Opaque".
  3771. Examples of suitable formats for Transparent copies include plain
  3772. ASCII without markup, Texinfo input format, LaTeX input format,
  3773. SGML or XML using a publicly available DTD, and standard-conforming
  3774. simple HTML, PostScript or PDF designed for human modification.
  3775. Examples of transparent image formats include PNG, XCF and JPG.
  3776. Opaque formats include proprietary formats that can be read and
  3777. edited only by proprietary word processors, SGML or XML for which
  3778. the DTD and/or processing tools are not generally available, and
  3779. the machine-generated HTML, PostScript or PDF produced by some word
  3780. processors for output purposes only.
  3781. The "Title Page" means, for a printed book, the title page itself,
  3782. plus such following pages as are needed to hold, legibly, the
  3783. material this License requires to appear in the title page. For
  3784. works in formats which do not have any title page as such, "Title
  3785. Page" means the text near the most prominent appearance of the
  3786. work's title, preceding the beginning of the body of the text.
  3787. The "publisher" means any person or entity that distributes copies
  3788. of the Document to the public.
  3789. A section "Entitled XYZ" means a named subunit of the Document
  3790. whose title either is precisely XYZ or contains XYZ in parentheses
  3791. following text that translates XYZ in another language. (Here XYZ
  3792. stands for a specific section name mentioned below, such as
  3793. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  3794. To "Preserve the Title" of such a section when you modify the
  3795. Document means that it remains a section "Entitled XYZ" according
  3796. to this definition.
  3797. The Document may include Warranty Disclaimers next to the notice
  3798. which states that this License applies to the Document. These
  3799. Warranty Disclaimers are considered to be included by reference in
  3800. this License, but only as regards disclaiming warranties: any other
  3801. implication that these Warranty Disclaimers may have is void and
  3802. has no effect on the meaning of this License.
  3803. 2. VERBATIM COPYING
  3804. You may copy and distribute the Document in any medium, either
  3805. commercially or noncommercially, provided that this License, the
  3806. copyright notices, and the license notice saying this License
  3807. applies to the Document are reproduced in all copies, and that you
  3808. add no other conditions whatsoever to those of this License. You
  3809. may not use technical measures to obstruct or control the reading
  3810. or further copying of the copies you make or distribute. However,
  3811. you may accept compensation in exchange for copies. If you
  3812. distribute a large enough number of copies you must also follow the
  3813. conditions in section 3.
  3814. You may also lend copies, under the same conditions stated above,
  3815. and you may publicly display copies.
  3816. 3. COPYING IN QUANTITY
  3817. If you publish printed copies (or copies in media that commonly
  3818. have printed covers) of the Document, numbering more than 100, and
  3819. the Document's license notice requires Cover Texts, you must
  3820. enclose the copies in covers that carry, clearly and legibly, all
  3821. these Cover Texts: Front-Cover Texts on the front cover, and
  3822. Back-Cover Texts on the back cover. Both covers must also clearly
  3823. and legibly identify you as the publisher of these copies. The
  3824. front cover must present the full title with all words of the title
  3825. equally prominent and visible. You may add other material on the
  3826. covers in addition. Copying with changes limited to the covers, as
  3827. long as they preserve the title of the Document and satisfy these
  3828. conditions, can be treated as verbatim copying in other respects.
  3829. If the required texts for either cover are too voluminous to fit
  3830. legibly, you should put the first ones listed (as many as fit
  3831. reasonably) on the actual cover, and continue the rest onto
  3832. adjacent pages.
  3833. If you publish or distribute Opaque copies of the Document
  3834. numbering more than 100, you must either include a machine-readable
  3835. Transparent copy along with each Opaque copy, or state in or with
  3836. each Opaque copy a computer-network location from which the general
  3837. network-using public has access to download using public-standard
  3838. network protocols a complete Transparent copy of the Document, free
  3839. of added material. If you use the latter option, you must take
  3840. reasonably prudent steps, when you begin distribution of Opaque
  3841. copies in quantity, to ensure that this Transparent copy will
  3842. remain thus accessible at the stated location until at least one
  3843. year after the last time you distribute an Opaque copy (directly or
  3844. through your agents or retailers) of that edition to the public.
  3845. It is requested, but not required, that you contact the authors of
  3846. the Document well before redistributing any large number of copies,
  3847. to give them a chance to provide you with an updated version of the
  3848. Document.
  3849. 4. MODIFICATIONS
  3850. You may copy and distribute a Modified Version of the Document
  3851. under the conditions of sections 2 and 3 above, provided that you
  3852. release the Modified Version under precisely this License, with the
  3853. Modified Version filling the role of the Document, thus licensing
  3854. distribution and modification of the Modified Version to whoever
  3855. possesses a copy of it. In addition, you must do these things in
  3856. the Modified Version:
  3857. A. Use in the Title Page (and on the covers, if any) a title
  3858. distinct from that of the Document, and from those of previous
  3859. versions (which should, if there were any, be listed in the
  3860. History section of the Document). You may use the same title
  3861. as a previous version if the original publisher of that
  3862. version gives permission.
  3863. B. List on the Title Page, as authors, one or more persons or
  3864. entities responsible for authorship of the modifications in
  3865. the Modified Version, together with at least five of the
  3866. principal authors of the Document (all of its principal
  3867. authors, if it has fewer than five), unless they release you
  3868. from this requirement.
  3869. C. State on the Title page the name of the publisher of the
  3870. Modified Version, as the publisher.
  3871. D. Preserve all the copyright notices of the Document.
  3872. E. Add an appropriate copyright notice for your modifications
  3873. adjacent to the other copyright notices.
  3874. F. Include, immediately after the copyright notices, a license
  3875. notice giving the public permission to use the Modified
  3876. Version under the terms of this License, in the form shown in
  3877. the Addendum below.
  3878. G. Preserve in that license notice the full lists of Invariant
  3879. Sections and required Cover Texts given in the Document's
  3880. license notice.
  3881. H. Include an unaltered copy of this License.
  3882. I. Preserve the section Entitled "History", Preserve its Title,
  3883. and add to it an item stating at least the title, year, new
  3884. authors, and publisher of the Modified Version as given on the
  3885. Title Page. If there is no section Entitled "History" in the
  3886. Document, create one stating the title, year, authors, and
  3887. publisher of the Document as given on its Title Page, then add
  3888. an item describing the Modified Version as stated in the
  3889. previous sentence.
  3890. J. Preserve the network location, if any, given in the Document
  3891. for public access to a Transparent copy of the Document, and
  3892. likewise the network locations given in the Document for
  3893. previous versions it was based on. These may be placed in the
  3894. "History" section. You may omit a network location for a work
  3895. that was published at least four years before the Document
  3896. itself, or if the original publisher of the version it refers
  3897. to gives permission.
  3898. K. For any section Entitled "Acknowledgements" or "Dedications",
  3899. Preserve the Title of the section, and preserve in the section
  3900. all the substance and tone of each of the contributor
  3901. acknowledgements and/or dedications given therein.
  3902. L. Preserve all the Invariant Sections of the Document, unaltered
  3903. in their text and in their titles. Section numbers or the
  3904. equivalent are not considered part of the section titles.
  3905. M. Delete any section Entitled "Endorsements". Such a section
  3906. may not be included in the Modified Version.
  3907. N. Do not retitle any existing section to be Entitled
  3908. "Endorsements" or to conflict in title with any Invariant
  3909. Section.
  3910. O. Preserve any Warranty Disclaimers.
  3911. If the Modified Version includes new front-matter sections or
  3912. appendices that qualify as Secondary Sections and contain no
  3913. material copied from the Document, you may at your option designate
  3914. some or all of these sections as invariant. To do this, add their
  3915. titles to the list of Invariant Sections in the Modified Version's
  3916. license notice. These titles must be distinct from any other
  3917. section titles.
  3918. You may add a section Entitled "Endorsements", provided it contains
  3919. nothing but endorsements of your Modified Version by various
  3920. parties--for example, statements of peer review or that the text
  3921. has been approved by an organization as the authoritative
  3922. definition of a standard.
  3923. You may add a passage of up to five words as a Front-Cover Text,
  3924. and a passage of up to 25 words as a Back-Cover Text, to the end of
  3925. the list of Cover Texts in the Modified Version. Only one passage
  3926. of Front-Cover Text and one of Back-Cover Text may be added by (or
  3927. through arrangements made by) any one entity. If the Document
  3928. already includes a cover text for the same cover, previously added
  3929. by you or by arrangement made by the same entity you are acting on
  3930. behalf of, you may not add another; but you may replace the old
  3931. one, on explicit permission from the previous publisher that added
  3932. the old one.
  3933. The author(s) and publisher(s) of the Document do not by this
  3934. License give permission to use their names for publicity for or to
  3935. assert or imply endorsement of any Modified Version.
  3936. 5. COMBINING DOCUMENTS
  3937. You may combine the Document with other documents released under
  3938. this License, under the terms defined in section 4 above for
  3939. modified versions, provided that you include in the combination all
  3940. of the Invariant Sections of all of the original documents,
  3941. unmodified, and list them all as Invariant Sections of your
  3942. combined work in its license notice, and that you preserve all
  3943. their Warranty Disclaimers.
  3944. The combined work need only contain one copy of this License, and
  3945. multiple identical Invariant Sections may be replaced with a single
  3946. copy. If there are multiple Invariant Sections with the same name
  3947. but different contents, make the title of each such section unique
  3948. by adding at the end of it, in parentheses, the name of the
  3949. original author or publisher of that section if known, or else a
  3950. unique number. Make the same adjustment to the section titles in
  3951. the list of Invariant Sections in the license notice of the
  3952. combined work.
  3953. In the combination, you must combine any sections Entitled
  3954. "History" in the various original documents, forming one section
  3955. Entitled "History"; likewise combine any sections Entitled
  3956. "Acknowledgements", and any sections Entitled "Dedications". You
  3957. must delete all sections Entitled "Endorsements."
  3958. 6. COLLECTIONS OF DOCUMENTS
  3959. You may make a collection consisting of the Document and other
  3960. documents released under this License, and replace the individual
  3961. copies of this License in the various documents with a single copy
  3962. that is included in the collection, provided that you follow the
  3963. rules of this License for verbatim copying of each of the documents
  3964. in all other respects.
  3965. You may extract a single document from such a collection, and
  3966. distribute it individually under this License, provided you insert
  3967. a copy of this License into the extracted document, and follow this
  3968. License in all other respects regarding verbatim copying of that
  3969. document.
  3970. 7. AGGREGATION WITH INDEPENDENT WORKS
  3971. A compilation of the Document or its derivatives with other
  3972. separate and independent documents or works, in or on a volume of a
  3973. storage or distribution medium, is called an "aggregate" if the
  3974. copyright resulting from the compilation is not used to limit the
  3975. legal rights of the compilation's users beyond what the individual
  3976. works permit. When the Document is included in an aggregate, this
  3977. License does not apply to the other works in the aggregate which
  3978. are not themselves derivative works of the Document.
  3979. If the Cover Text requirement of section 3 is applicable to these
  3980. copies of the Document, then if the Document is less than one half
  3981. of the entire aggregate, the Document's Cover Texts may be placed
  3982. on covers that bracket the Document within the aggregate, or the
  3983. electronic equivalent of covers if the Document is in electronic
  3984. form. Otherwise they must appear on printed covers that bracket
  3985. the whole aggregate.
  3986. 8. TRANSLATION
  3987. Translation is considered a kind of modification, so you may
  3988. distribute translations of the Document under the terms of section
  3989. 4. Replacing Invariant Sections with translations requires special
  3990. permission from their copyright holders, but you may include
  3991. translations of some or all Invariant Sections in addition to the
  3992. original versions of these Invariant Sections. You may include a
  3993. translation of this License, and all the license notices in the
  3994. Document, and any Warranty Disclaimers, provided that you also
  3995. include the original English version of this License and the
  3996. original versions of those notices and disclaimers. In case of a
  3997. disagreement between the translation and the original version of
  3998. this License or a notice or disclaimer, the original version will
  3999. prevail.
  4000. If a section in the Document is Entitled "Acknowledgements",
  4001. "Dedications", or "History", the requirement (section 4) to
  4002. Preserve its Title (section 1) will typically require changing the
  4003. actual title.
  4004. 9. TERMINATION
  4005. You may not copy, modify, sublicense, or distribute the Document
  4006. except as expressly provided under this License. Any attempt
  4007. otherwise to copy, modify, sublicense, or distribute it is void,
  4008. and will automatically terminate your rights under this License.
  4009. However, if you cease all violation of this License, then your
  4010. license from a particular copyright holder is reinstated (a)
  4011. provisionally, unless and until the copyright holder explicitly and
  4012. finally terminates your license, and (b) permanently, if the
  4013. copyright holder fails to notify you of the violation by some
  4014. reasonable means prior to 60 days after the cessation.
  4015. Moreover, your license from a particular copyright holder is
  4016. reinstated permanently if the copyright holder notifies you of the
  4017. violation by some reasonable means, this is the first time you have
  4018. received notice of violation of this License (for any work) from
  4019. that copyright holder, and you cure the violation prior to 30 days
  4020. after your receipt of the notice.
  4021. Termination of your rights under this section does not terminate
  4022. the licenses of parties who have received copies or rights from you
  4023. under this License. If your rights have been terminated and not
  4024. permanently reinstated, receipt of a copy of some or all of the
  4025. same material does not give you any rights to use it.
  4026. 10. FUTURE REVISIONS OF THIS LICENSE
  4027. The Free Software Foundation may publish new, revised versions of
  4028. the GNU Free Documentation License from time to time. Such new
  4029. versions will be similar in spirit to the present version, but may
  4030. differ in detail to address new problems or concerns. See
  4031. <http://www.gnu.org/copyleft/>.
  4032. Each version of the License is given a distinguishing version
  4033. number. If the Document specifies that a particular numbered
  4034. version of this License "or any later version" applies to it, you
  4035. have the option of following the terms and conditions either of
  4036. that specified version or of any later version that has been
  4037. published (not as a draft) by the Free Software Foundation. If the
  4038. Document does not specify a version number of this License, you may
  4039. choose any version ever published (not as a draft) by the Free
  4040. Software Foundation. If the Document specifies that a proxy can
  4041. decide which future versions of this License can be used, that
  4042. proxy's public statement of acceptance of a version permanently
  4043. authorizes you to choose that version for the Document.
  4044. 11. RELICENSING
  4045. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  4046. World Wide Web server that publishes copyrightable works and also
  4047. provides prominent facilities for anybody to edit those works. A
  4048. public wiki that anybody can edit is an example of such a server.
  4049. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  4050. site means any set of copyrightable works thus published on the MMC
  4051. site.
  4052. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  4053. license published by Creative Commons Corporation, a not-for-profit
  4054. corporation with a principal place of business in San Francisco,
  4055. California, as well as future copyleft versions of that license
  4056. published by that same organization.
  4057. "Incorporate" means to publish or republish a Document, in whole or
  4058. in part, as part of another Document.
  4059. An MMC is "eligible for relicensing" if it is licensed under this
  4060. License, and if all works that were first published under this
  4061. License somewhere other than this MMC, and subsequently
  4062. incorporated in whole or in part into the MMC, (1) had no cover
  4063. texts or invariant sections, and (2) were thus incorporated prior
  4064. to November 1, 2008.
  4065. The operator of an MMC Site may republish an MMC contained in the
  4066. site under CC-BY-SA on the same site at any time before August 1,
  4067. 2009, provided the MMC is eligible for relicensing.
  4068. ADDENDUM: How to use this License for your documents
  4069. ====================================================
  4070. To use this License in a document you have written, include a copy of
  4071. the License in the document and put the following copyright and license
  4072. notices just after the title page:
  4073. Copyright (C) YEAR YOUR NAME.
  4074. Permission is granted to copy, distribute and/or modify this document
  4075. under the terms of the GNU Free Documentation License, Version 1.3
  4076. or any later version published by the Free Software Foundation;
  4077. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  4078. Texts. A copy of the license is included in the section entitled ``GNU
  4079. Free Documentation License''.
  4080. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  4081. Texts, replace the "with...Texts." line with this:
  4082. with the Invariant Sections being LIST THEIR TITLES, with
  4083. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  4084. being LIST.
  4085. If you have Invariant Sections without Cover Texts, or some other
  4086. combination of the three, merge those two alternatives to suit the
  4087. situation.
  4088. If your document contains nontrivial examples of program code, we
  4089. recommend releasing these examples in parallel under your choice of free
  4090. software license, such as the GNU General Public License, to permit
  4091. their use in free software.
  4092. 
  4093. File: x86_64-linux-gnu-cpp.info, Node: Index of Directives, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
  4094. Index of Directives
  4095. *******************
  4096. �[index�]
  4097. * Menu:
  4098. * #assert: Obsolete Features. (line 48)
  4099. * #define: Object-like Macros. (line 11)
  4100. * #elif: Elif. (line 6)
  4101. * #else: Else. (line 6)
  4102. * #endif: Ifdef. (line 6)
  4103. * #error: Diagnostics. (line 6)
  4104. * #ident: Other Directives. (line 6)
  4105. * #if: Conditional Syntax. (line 6)
  4106. * #ifdef: Ifdef. (line 6)
  4107. * #ifndef: Ifdef. (line 40)
  4108. * #import: Alternatives to Wrapper #ifndef.
  4109. (line 11)
  4110. * #include: Include Syntax. (line 6)
  4111. * #include_next: Wrapper Headers. (line 6)
  4112. * #line: Line Control. (line 20)
  4113. * #pragma GCC dependency: Pragmas. (line 43)
  4114. * #pragma GCC error: Pragmas. (line 88)
  4115. * #pragma GCC poison: Pragmas. (line 55)
  4116. * #pragma GCC system_header: System Headers. (line 25)
  4117. * #pragma GCC system_header <1>: Pragmas. (line 82)
  4118. * #pragma GCC warning: Pragmas. (line 87)
  4119. * #pragma once: Pragmas. (line 96)
  4120. * #sccs: Other Directives. (line 6)
  4121. * #unassert: Obsolete Features. (line 59)
  4122. * #undef: Undefining and Redefining Macros.
  4123. (line 6)
  4124. * #warning: Diagnostics. (line 27)
  4125. 
  4126. File: x86_64-linux-gnu-cpp.info, Node: Option Index, Next: Concept Index, Prev: Index of Directives, Up: Top
  4127. Option Index
  4128. ************
  4129. CPP's command-line options and environment variables are indexed here
  4130. without any initial '-' or '--'.
  4131. �[index�]
  4132. * Menu:
  4133. * A: Invocation. (line 329)
  4134. * C: Invocation. (line 338)
  4135. * CC: Invocation. (line 350)
  4136. * CPATH: Environment Variables.
  4137. (line 15)
  4138. * CPLUS_INCLUDE_PATH: Environment Variables.
  4139. (line 17)
  4140. * C_INCLUDE_PATH: Environment Variables.
  4141. (line 16)
  4142. * D: Invocation. (line 44)
  4143. * d: Invocation. (line 399)
  4144. * dD: Invocation. (line 418)
  4145. * DEPENDENCIES_OUTPUT: Environment Variables.
  4146. (line 45)
  4147. * dI: Invocation. (line 428)
  4148. * dM: Invocation. (line 407)
  4149. * dN: Invocation. (line 424)
  4150. * dU: Invocation. (line 432)
  4151. * fdebug-cpp: Invocation. (line 439)
  4152. * fdirectives-only: Invocation. (line 228)
  4153. * fdollars-in-identifiers: Invocation. (line 249)
  4154. * fexec-charset: Invocation. (line 292)
  4155. * fextended-identifiers: Invocation. (line 252)
  4156. * finput-charset: Invocation. (line 305)
  4157. * fmacro-prefix-map: Invocation. (line 283)
  4158. * fno-canonical-system-headers: Invocation. (line 256)
  4159. * fno-working-directory: Invocation. (line 315)
  4160. * fpreprocessed: Invocation. (line 215)
  4161. * ftabstop: Invocation. (line 260)
  4162. * ftrack-macro-expansion: Invocation. (line 266)
  4163. * fwide-exec-charset: Invocation. (line 297)
  4164. * fworking-directory: Invocation. (line 315)
  4165. * H: Invocation. (line 392)
  4166. * I: Invocation. (line 450)
  4167. * I-: Invocation. (line 504)
  4168. * idirafter: Invocation. (line 450)
  4169. * imacros: Invocation. (line 82)
  4170. * imultilib: Invocation. (line 538)
  4171. * include: Invocation. (line 71)
  4172. * iprefix: Invocation. (line 520)
  4173. * iquote: Invocation. (line 450)
  4174. * isysroot: Invocation. (line 532)
  4175. * isystem: Invocation. (line 450)
  4176. * iwithprefix: Invocation. (line 526)
  4177. * iwithprefixbefore: Invocation. (line 526)
  4178. * M: Invocation. (line 103)
  4179. * MD: Invocation. (line 195)
  4180. * MF: Invocation. (line 137)
  4181. * MG: Invocation. (line 148)
  4182. * MM: Invocation. (line 128)
  4183. * MMD: Invocation. (line 211)
  4184. * MP: Invocation. (line 158)
  4185. * MQ: Invocation. (line 185)
  4186. * MT: Invocation. (line 170)
  4187. * nostdinc: Invocation. (line 542)
  4188. * nostdinc++: Invocation. (line 548)
  4189. * OBJC_INCLUDE_PATH: Environment Variables.
  4190. (line 18)
  4191. * P: Invocation. (line 362)
  4192. * pthread: Invocation. (line 96)
  4193. * remap: Invocation. (line 388)
  4194. * SOURCE_DATE_EPOCH: Environment Variables.
  4195. (line 67)
  4196. * SUNPRO_DEPENDENCIES: Environment Variables.
  4197. (line 61)
  4198. * traditional: Invocation. (line 370)
  4199. * traditional-cpp: Invocation. (line 370)
  4200. * trigraphs: Invocation. (line 379)
  4201. * U: Invocation. (line 67)
  4202. * undef: Invocation. (line 91)
  4203. * Wcomment: Invocation. (line 554)
  4204. * Wcomments: Invocation. (line 554)
  4205. * Wendif-labels: Invocation. (line 598)
  4206. * Wexpansion-to-defined: Invocation. (line 573)
  4207. * Wno-endif-labels: Invocation. (line 598)
  4208. * Wno-undef: Invocation. (line 569)
  4209. * Wtrigraphs: Invocation. (line 559)
  4210. * Wundef: Invocation. (line 569)
  4211. * Wunused-macros: Invocation. (line 579)
  4212. 
  4213. File: x86_64-linux-gnu-cpp.info, Node: Concept Index, Prev: Option Index, Up: Top
  4214. Concept Index
  4215. *************
  4216. �[index�]
  4217. * Menu:
  4218. * # operator: Stringizing. (line 6)
  4219. * ## operator: Concatenation. (line 6)
  4220. * _Pragma: Pragmas. (line 13)
  4221. * __has_attribute: __has_attribute. (line 6)
  4222. * __has_cpp_attribute: __has_cpp_attribute. (line 6)
  4223. * __has_include: __has_include. (line 6)
  4224. * alternative tokens: Tokenization. (line 101)
  4225. * arguments: Macro Arguments. (line 6)
  4226. * arguments in macro definitions: Macro Arguments. (line 6)
  4227. * assertions: Obsolete Features. (line 13)
  4228. * assertions, canceling: Obsolete Features. (line 59)
  4229. * backslash-newline: Initial processing. (line 61)
  4230. * block comments: Initial processing. (line 77)
  4231. * C language, traditional: Invocation. (line 368)
  4232. * C++ named operators: C++ Named Operators. (line 6)
  4233. * character constants: Tokenization. (line 82)
  4234. * character set, execution: Invocation. (line 292)
  4235. * character set, input: Invocation. (line 305)
  4236. * character set, wide execution: Invocation. (line 297)
  4237. * command line: Invocation. (line 6)
  4238. * commenting out code: Deleted Code. (line 6)
  4239. * comments: Initial processing. (line 77)
  4240. * common predefined macros: Common Predefined Macros.
  4241. (line 6)
  4242. * computed includes: Computed Includes. (line 6)
  4243. * concatenation: Concatenation. (line 6)
  4244. * conditional group: Ifdef. (line 14)
  4245. * conditionals: Conditionals. (line 6)
  4246. * continued lines: Initial processing. (line 61)
  4247. * controlling macro: Once-Only Headers. (line 35)
  4248. * defined: Defined. (line 6)
  4249. * dependencies for make as output: Environment Variables.
  4250. (line 46)
  4251. * dependencies for make as output <1>: Environment Variables.
  4252. (line 62)
  4253. * dependencies, make: Invocation. (line 103)
  4254. * diagnostic: Diagnostics. (line 6)
  4255. * digraphs: Tokenization. (line 101)
  4256. * directive line: The preprocessing language.
  4257. (line 6)
  4258. * directive name: The preprocessing language.
  4259. (line 6)
  4260. * directives: The preprocessing language.
  4261. (line 6)
  4262. * empty macro arguments: Macro Arguments. (line 66)
  4263. * environment variables: Environment Variables.
  4264. (line 6)
  4265. * expansion of arguments: Argument Prescan. (line 6)
  4266. * FDL, GNU Free Documentation License: GNU Free Documentation License.
  4267. (line 6)
  4268. * function-like macros: Function-like Macros.
  4269. (line 6)
  4270. * grouping options: Invocation. (line 38)
  4271. * guard macro: Once-Only Headers. (line 35)
  4272. * header file: Header Files. (line 6)
  4273. * header file names: Tokenization. (line 82)
  4274. * identifiers: Tokenization. (line 33)
  4275. * implementation limits: Implementation limits.
  4276. (line 6)
  4277. * implementation-defined behavior: Implementation-defined behavior.
  4278. (line 6)
  4279. * including just once: Once-Only Headers. (line 6)
  4280. * invocation: Invocation. (line 6)
  4281. * iso646.h: C++ Named Operators. (line 6)
  4282. * line comments: Initial processing. (line 77)
  4283. * line control: Line Control. (line 6)
  4284. * line endings: Initial processing. (line 14)
  4285. * linemarkers: Preprocessor Output. (line 27)
  4286. * macro argument expansion: Argument Prescan. (line 6)
  4287. * macro arguments and directives: Directives Within Macro Arguments.
  4288. (line 6)
  4289. * macros in include: Computed Includes. (line 6)
  4290. * macros with arguments: Macro Arguments. (line 6)
  4291. * macros with variable arguments: Variadic Macros. (line 6)
  4292. * make: Invocation. (line 103)
  4293. * manifest constants: Object-like Macros. (line 6)
  4294. * named operators: C++ Named Operators. (line 6)
  4295. * newlines in macro arguments: Newlines in Arguments.
  4296. (line 6)
  4297. * null directive: Other Directives. (line 15)
  4298. * numbers: Tokenization. (line 59)
  4299. * object-like macro: Object-like Macros. (line 6)
  4300. * options: Invocation. (line 43)
  4301. * options, grouping: Invocation. (line 38)
  4302. * other tokens: Tokenization. (line 115)
  4303. * output format: Preprocessor Output. (line 12)
  4304. * overriding a header file: Wrapper Headers. (line 6)
  4305. * parentheses in macro bodies: Operator Precedence Problems.
  4306. (line 6)
  4307. * pitfalls of macros: Macro Pitfalls. (line 6)
  4308. * pragma directive: Pragmas. (line 6)
  4309. * predefined macros: Predefined Macros. (line 6)
  4310. * predefined macros, system-specific: System-specific Predefined Macros.
  4311. (line 6)
  4312. * predicates: Obsolete Features. (line 26)
  4313. * preprocessing directives: The preprocessing language.
  4314. (line 6)
  4315. * preprocessing numbers: Tokenization. (line 59)
  4316. * preprocessing tokens: Tokenization. (line 6)
  4317. * prescan of macro arguments: Argument Prescan. (line 6)
  4318. * problems with macros: Macro Pitfalls. (line 6)
  4319. * punctuators: Tokenization. (line 101)
  4320. * redefining macros: Undefining and Redefining Macros.
  4321. (line 6)
  4322. * repeated inclusion: Once-Only Headers. (line 6)
  4323. * reporting errors: Diagnostics. (line 6)
  4324. * reporting warnings: Diagnostics. (line 6)
  4325. * reserved namespace: System-specific Predefined Macros.
  4326. (line 6)
  4327. * self-reference: Self-Referential Macros.
  4328. (line 6)
  4329. * semicolons (after macro calls): Swallowing the Semicolon.
  4330. (line 6)
  4331. * side effects (in macro arguments): Duplication of Side Effects.
  4332. (line 6)
  4333. * standard predefined macros.: Standard Predefined Macros.
  4334. (line 6)
  4335. * string constants: Tokenization. (line 82)
  4336. * string literals: Tokenization. (line 82)
  4337. * stringizing: Stringizing. (line 6)
  4338. * symbolic constants: Object-like Macros. (line 6)
  4339. * system header files: Header Files. (line 13)
  4340. * system header files <1>: System Headers. (line 6)
  4341. * system-specific predefined macros: System-specific Predefined Macros.
  4342. (line 6)
  4343. * testing predicates: Obsolete Features. (line 37)
  4344. * token concatenation: Concatenation. (line 6)
  4345. * token pasting: Concatenation. (line 6)
  4346. * tokens: Tokenization. (line 6)
  4347. * traditional C language: Invocation. (line 368)
  4348. * trigraphs: Initial processing. (line 32)
  4349. * undefining macros: Undefining and Redefining Macros.
  4350. (line 6)
  4351. * unsafe macros: Duplication of Side Effects.
  4352. (line 6)
  4353. * variable number of arguments: Variadic Macros. (line 6)
  4354. * variadic macros: Variadic Macros. (line 6)
  4355. * wrapper #ifndef: Once-Only Headers. (line 6)
  4356. * wrapper headers: Wrapper Headers. (line 6)
  4357. 
  4358. Tag Table:
  4359. Node: Top996
  4360. Node: Overview3574
  4361. Node: Character sets6429
  4362. Ref: Character sets-Footnote-18601
  4363. Node: Initial processing8782
  4364. Ref: trigraphs10358
  4365. Node: Tokenization14558
  4366. Ref: Tokenization-Footnote-121476
  4367. Node: The preprocessing language21587
  4368. Node: Header Files24483
  4369. Node: Include Syntax26416
  4370. Node: Include Operation28070
  4371. Node: Search Path29935
  4372. Node: Once-Only Headers32174
  4373. Node: Alternatives to Wrapper #ifndef33850
  4374. Node: Computed Includes35516
  4375. Node: Wrapper Headers38691
  4376. Node: System Headers41131
  4377. Node: Macros42749
  4378. Node: Object-like Macros43903
  4379. Node: Function-like Macros47510
  4380. Node: Macro Arguments49143
  4381. Node: Stringizing53299
  4382. Node: Concatenation56477
  4383. Node: Variadic Macros59591
  4384. Node: Predefined Macros64560
  4385. Node: Standard Predefined Macros65165
  4386. Node: Common Predefined Macros71514
  4387. Node: System-specific Predefined Macros92634
  4388. Node: C++ Named Operators94674
  4389. Node: Undefining and Redefining Macros95655
  4390. Node: Directives Within Macro Arguments97770
  4391. Node: Macro Pitfalls98728
  4392. Node: Misnesting99278
  4393. Node: Operator Precedence Problems100407
  4394. Node: Swallowing the Semicolon102290
  4395. Node: Duplication of Side Effects104330
  4396. Node: Self-Referential Macros106530
  4397. Node: Argument Prescan108956
  4398. Node: Newlines in Arguments112724
  4399. Node: Conditionals113692
  4400. Node: Conditional Uses115405
  4401. Node: Conditional Syntax116780
  4402. Node: Ifdef117179
  4403. Node: If120353
  4404. Node: Defined122674
  4405. Node: Else124084
  4406. Node: Elif124671
  4407. Node: __has_attribute126001
  4408. Node: __has_cpp_attribute127552
  4409. Node: __has_include128455
  4410. Node: Deleted Code130065
  4411. Node: Diagnostics131329
  4412. Node: Line Control132895
  4413. Node: Pragmas135190
  4414. Node: Other Directives139604
  4415. Node: Preprocessor Output140671
  4416. Node: Traditional Mode143841
  4417. Node: Traditional lexical analysis144995
  4418. Node: Traditional macros147515
  4419. Node: Traditional miscellany151329
  4420. Node: Traditional warnings152342
  4421. Node: Implementation Details154556
  4422. Node: Implementation-defined behavior155136
  4423. Ref: Identifier characters155903
  4424. Node: Implementation limits158770
  4425. Node: Obsolete Features161460
  4426. Node: Invocation164321
  4427. Ref: dashMF170373
  4428. Ref: fdollars-in-identifiers174952
  4429. Ref: Wtrigraphs188948
  4430. Node: Environment Variables191003
  4431. Node: GNU Free Documentation License194713
  4432. Node: Index of Directives219875
  4433. Node: Option Index222045
  4434. Node: Concept Index228018
  4435. 
  4436. End Tag Table
  4437. 
  4438. Local Variables:
  4439. coding: utf-8
  4440. End: