newdiffs-gnuexts.txt 189 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795
  1. diff -Nur gnuexts/SEC100.hss fix/gnuexts/SEC100.hss
  2. --- gnuexts/SEC100.hss 2003-09-16 16:47:40.000000000 +0200
  3. +++ fix/gnuexts/SEC100.hss 2003-09-16 23:37:32.000000000 +0200
  4. @@ -1,5 +1,6 @@
  5. [Main]
  6. Title=Alternate Keywords
  7. +Index=__const__, __extension__
  8. [Top]
  9. <B>'-ansi'</B> and the various <B>'-std'</B> options disable certain
  10. diff -Nur gnuexts/SEC101.hss fix/gnuexts/SEC101.hss
  11. --- gnuexts/SEC101.hss 2003-09-16 16:47:40.000000000 +0200
  12. +++ fix/gnuexts/SEC101.hss 2003-09-16 22:56:06.000000000 +0200
  13. @@ -1,5 +1,5 @@
  14. [Main]
  15. -Title=Incomplete @code{enum} Types
  16. +Title=Incomplete 'enum' Types
  17. [Top]
  18. You can define an <CODE>enum</CODE> tag without specifying its possible values.
  19. @@ -13,5 +13,3 @@
  20. This extension may not be very useful, but it makes the handling of
  21. <CODE>enum</CODE> more consistent with the way <CODE>struct</CODE> and <CODE>union</CODE>
  22. are handled.
  23. -<BR><BR>
  24. -This extension is not supported by GNU C++.
  25. diff -Nur gnuexts/SEC102.hss fix/gnuexts/SEC102.hss
  26. --- gnuexts/SEC102.hss 2003-09-16 16:47:42.000000000 +0200
  27. +++ fix/gnuexts/SEC102.hss 2003-09-16 22:56:06.000000000 +0200
  28. @@ -1,5 +1,6 @@
  29. [Main]
  30. Title=Function Names as Strings
  31. +Index=__func__, __FUNCTION__, __PRETTY_FUNCTION__
  32. [Top]
  33. GCC predefines two magic identifiers to hold the name of the current
  34. @@ -7,35 +8,10 @@
  35. as it appears in the source. The identifier <CODE>__PRETTY_FUNCTION__</CODE>
  36. holds the name of the function pretty printed in a language specific
  37. fashion.
  38. +(These names are always the same in a C function, but in a C++ function
  39. +they may be different; don't care about this, because TIGCC is not a C++ compiler.)
  40. <BR><BR>
  41. -These names are always the same in a C function, but in a C++ function
  42. -they may be different. For example, this program:
  43. -<PRE>extern &quot;C&quot; {
  44. -extern int printf (char *, ...);
  45. -}
  46. -
  47. -class a {
  48. - public:
  49. - sub (int i)
  50. - {
  51. - printf (&quot;__FUNCTION__ = %s\n&quot;, __FUNCTION__);
  52. - printf (&quot;__PRETTY_FUNCTION__ = %s\n&quot;, __PRETTY_FUNCTION__);
  53. - }
  54. -};
  55. -
  56. -int
  57. -main (void)
  58. -{
  59. - a ax;
  60. - ax.sub (0);
  61. - return 0;
  62. -}
  63. -</PRE>
  64. -gives this output:
  65. -<PRE>__FUNCTION__ = sub
  66. -__PRETTY_FUNCTION__ = int a::sub (int)
  67. -</PRE>
  68. -The compiler automagically replaces the identifiers with a string
  69. +The compiler automatically replaces the identifiers with a string
  70. literal containing the appropriate name. Thus, they are neither
  71. preprocessor macros, like <CODE>__FILE__</CODE> and <CODE>__LINE__</CODE>, nor
  72. variables. This means that they catenate with other string literals, and
  73. @@ -61,6 +37,3 @@
  74. By this definition, <CODE>__func__</CODE> is a variable, not a string literal.
  75. In particular, <CODE>__func__</CODE> does not catenate with other string
  76. literals.
  77. -<BR><BR>
  78. -In <CODE>C++</CODE>, <CODE>__FUNCTION__</CODE> and <CODE>__PRETTY_FUNCTION__</CODE> are
  79. -variables, declared in the same way as <CODE>__func__</CODE>.
  80. diff -Nur gnuexts/SEC103.hss fix/gnuexts/SEC103.hss
  81. --- gnuexts/SEC103.hss 2003-09-16 16:47:42.000000000 +0200
  82. +++ fix/gnuexts/SEC103.hss 2003-09-16 22:56:06.000000000 +0200
  83. @@ -1,5 +1,6 @@
  84. [Main]
  85. Title=Getting the Return or Frame Address of a Function
  86. +Subsections=SEC103___builtin_return_address, SEC103___builtin_frame_address
  87. [Top]
  88. These functions may be used to get information about the callers of a
  89. diff -Nur gnuexts/SEC103___builtin_frame_address.hss fix/gnuexts/SEC103___builtin_frame_address.hss
  90. --- gnuexts/SEC103___builtin_frame_address.hss 2003-09-16 16:47:42.000000000 +0200
  91. +++ fix/gnuexts/SEC103___builtin_frame_address.hss 2003-09-16 22:56:06.000000000 +0200
  92. @@ -2,25 +2,22 @@
  93. Title=__builtin_frame_address
  94. [Top]
  95. -This function is similar to <CODE>__builtin_return_address</CODE>, but it
  96. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *__builtin_frame_address (<B><A HREF="$$INFOLINK(keywords/int)">int</A></B> level);</CODE>
  97. +<BR><BR>
  98. +This function is similar to <A HREF="$$LINK(SEC103___builtin_return_address)">__builtin_return_address</A>, but it
  99. returns the address of the function frame rather than the return address
  100. -of the function. Calling <CODE>__builtin_frame_address</CODE> with a value of
  101. -<CODE>0</CODE> yields the frame address of the current function, a value of
  102. -<CODE>1</CODE> yields the frame address of the caller of the current function,
  103. +of the function. Calling __builtin_frame_address with a value of
  104. +0 yields the frame address of the current function, a value of
  105. +1 yields the frame address of the caller of the current function,
  106. and so forth.
  107. <BR><BR>
  108. The frame is the area on the stack which holds local variables and saved
  109. registers. The frame address is normally the address of the first word
  110. pushed on to the stack by the function. However, the exact definition
  111. -depends upon the processor and the calling convention. If the processor
  112. -has a dedicated frame pointer register, and the function has a frame,
  113. -then <CODE>__builtin_frame_address</CODE> will return the value of the frame
  114. -pointer register.
  115. -<BR><BR>
  116. -On some machines it may be impossible to determine the frame address of
  117. -any function other than the current one; in such cases, or when the top
  118. -of the stack has been reached, this function will return <CODE>0</CODE> if
  119. -the first frame pointer is properly initialized by the startup code.
  120. +depends upon the processor and the calling convention. On the Motorola
  121. +68000, if the function has a frame,
  122. +then __builtin_frame_address will return the value of the frame
  123. +pointer register <CODE>a6</CODE> if <I>level</I> is 0.
  124. <BR><BR>
  125. -This function should only be used with a nonzero argument for debugging
  126. +This function should be used with a nonzero argument only for debugging
  127. purposes.
  128. diff -Nur gnuexts/SEC103___builtin_return_address.hss fix/gnuexts/SEC103___builtin_return_address.hss
  129. --- gnuexts/SEC103___builtin_return_address.hss 2003-09-16 16:47:42.000000000 +0200
  130. +++ fix/gnuexts/SEC103___builtin_return_address.hss 2003-09-16 23:39:26.000000000 +0200
  131. @@ -2,6 +2,8 @@
  132. Title=__builtin_return_address
  133. [Top]
  134. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *__builtin_return_address (<B><A HREF="$$INFOLINK(keywords/int)">int</A></B> level);</CODE>
  135. +<BR><BR>
  136. This function returns the return address of the current function, or of
  137. one of its callers. The <I>level</I> argument is number of frames to
  138. scan up the call stack. A value of <CODE>0</CODE> yields the return address
  139. @@ -13,11 +15,12 @@
  140. <BR><BR>
  141. The <I>level</I> argument must be a constant integer.
  142. <BR><BR>
  143. -On some machines it may be impossible to determine the return address of
  144. +Sometimes (especially without a frame pointer)
  145. +it may be impossible to determine the return address of
  146. any function other than the current one; in such cases, or when the top
  147. -of the stack has been reached, this function will return <CODE>0</CODE> or a
  148. -random value. In addition, <CODE>__builtin_frame_address</CODE> may be used
  149. +of the stack has been reached, this function will return a
  150. +random value. In addition, <A HREF="$$LINK(SEC103___builtin_frame_address)">__builtin_frame_address</A> may be used
  151. to determine if the top of the stack has been reached.
  152. <BR><BR>
  153. -This function should only be used with a nonzero argument for debugging
  154. +This function should be used with a nonzero argument only for debugging
  155. purposes.
  156. diff -Nur gnuexts/SEC104.hss fix/gnuexts/SEC104.hss
  157. --- gnuexts/SEC104.hss 2003-09-16 16:47:46.000000000 +0200
  158. +++ fix/gnuexts/SEC104.hss 2003-09-16 22:56:06.000000000 +0200
  159. @@ -1,26 +1,28 @@
  160. [Main]
  161. Title=Other built-in functions provided by GCC
  162. +Subsections=SEC104___builtin_constant_p, SEC104___builtin_types_compatible_p, SEC104___builtin_choose_expr, SEC104___builtin_expect, SEC104___builtin_prefetch
  163. [Top]
  164. -GCC provides a large number of built-in functions other than the ones
  165. -mentioned above. Some of these are for internal use in the processing
  166. +GCC provides a large number of built-in functions. Some of these are for internal use in the processing
  167. of exceptions or variable-length argument lists and will not be
  168. documented here because they may change from time to time; we do not
  169. recommend general use of these functions.
  170. <BR><BR>
  171. The remaining functions are provided for optimization purposes.
  172. -<BR><BR>
  173. +
  174. +[Bottom]
  175. GCC includes built-in versions of many of the functions in the standard
  176. C library. The versions prefixed with <CODE>__builtin_</CODE> will always be
  177. treated as having the same meaning as the C library function even if you
  178. -specify the <B>'-fno-builtin'</B> option. (see <A HREF="$$INFOLINK(C Dialect Options)">C Dialect Options</A>)
  179. +specify the <B>'-fno-builtin'</B> option (see <A HREF="$$INFOLINK(comopts/SEC6)">C Dialect Options</A>).
  180. Many of these functions are only optimized in certain cases; if they are
  181. not optimized in a particular case, a call to the library function will
  182. -be emitted.
  183. +be emitted
  184. +(but this does not make sense in TIGCC, as the standard C library is not provided with it).
  185. <BR><BR>
  186. The functions <CODE>abort</CODE>, <CODE>exit</CODE>, <CODE>_Exit</CODE> and <CODE>_exit</CODE>
  187. are recognized and presumed not to return, but otherwise are not built
  188. -in. <CODE>_exit</CODE> is not recognized in strict ISO C mode (<B>'-ansi'</B>,
  189. +in (TIGCC defines them as macros anyway). <CODE>_exit</CODE> is not recognized in strict ISO C mode (<B>'-ansi'</B>,
  190. <B>'-std=c89'</B> or <B>'-std=c99'</B>). <CODE>_Exit</CODE> is not recognized in
  191. strict C89 mode (<B>'-ansi'</B> or <B>'-std=c89'</B>). All these functions
  192. have corresponding versions prefixed with <CODE>__builtin_</CODE>, which may be
  193. @@ -31,7 +33,9 @@
  194. <CODE>printf_unlocked</CODE> and <CODE>fprintf_unlocked</CODE> may be handled as
  195. built-in functions. All these functions have corresponding versions
  196. prefixed with <CODE>__builtin_</CODE>, which may be used even in strict C89
  197. -mode.
  198. +mode
  199. +(in TIGCC, <A HREF="$$LINK(alloc.h/alloca)">alloca</A> is built-in;
  200. +other than that only <CODE>__builtin_bzero</CODE> might be useful).
  201. <BR><BR>
  202. The ISO C99 functions <CODE>conj</CODE>, <CODE>conjf</CODE>, <CODE>conjl</CODE>,
  203. <CODE>creal</CODE>, <CODE>crealf</CODE>, <CODE>creall</CODE>, <CODE>cimag</CODE>, <CODE>cimagf</CODE>,
  204. @@ -43,7 +47,8 @@
  205. <CODE>logf</CODE>, <CODE>logl</CODE>, <CODE>sinf</CODE>, <CODE>sinl</CODE>, <CODE>sqrtf</CODE>, and
  206. <CODE>sqrtl</CODE>, that are recognized in any mode since ISO C90 reserves
  207. these names for the purpose to which ISO C99 puts them. All these
  208. -functions have corresponding versions prefixed with <CODE>__builtin_</CODE>.
  209. +functions have corresponding versions prefixed with <CODE>__builtin_</CODE>
  210. +(again, none of these are implemented in TIGCC).
  211. <BR><BR>
  212. The ISO C90 functions <CODE>abs</CODE>, <CODE>cos</CODE>, <CODE>exp</CODE>, <CODE>fabs</CODE>,
  213. <CODE>fprintf</CODE>, <CODE>fputs</CODE>, <CODE>labs</CODE>, <CODE>log</CODE>,
  214. @@ -58,12 +63,13 @@
  215. recognized as built-in functions unless <B>'-fno-builtin'</B> is
  216. specified (or <B>'-fno-builtin-<I>function</I>'</B> is specified for an
  217. individual function). All of these functions have corresponding
  218. -versions prefixed with <CODE>__builtin_</CODE>.
  219. +versions prefixed with <CODE>__builtin_</CODE>
  220. +(but most of these are defined as macros in TIGCC).
  221. <BR><BR>
  222. GCC provides built-in versions of the ISO C99 floating point comparison
  223. macros that avoid raising exceptions for unordered operands. They have
  224. -the same names as the standard macros ( <CODE>isgreater</CODE>,
  225. +the same names as the standard macros (<CODE>isgreater</CODE>,
  226. <CODE>isgreaterequal</CODE>, <CODE>isless</CODE>, <CODE>islessequal</CODE>,
  227. -<CODE>islessgreater</CODE>, and <CODE>isunordered</CODE>) , with <CODE>__builtin_</CODE>
  228. -prefixed. We intend for a library implementor to be able to simply
  229. +<CODE>islessgreater</CODE>, and <CODE>isunordered</CODE>), with <CODE>__builtin_</CODE>
  230. +prefixed. The GNU team intends for a library implementor to be able to simply
  231. <CODE>#define</CODE> each standard macro to its built-in equivalent.
  232. diff -Nur gnuexts/SEC104___builtin_choose_expr.hss fix/gnuexts/SEC104___builtin_choose_expr.hss
  233. --- gnuexts/SEC104___builtin_choose_expr.hss 2003-09-16 16:47:44.000000000 +0200
  234. +++ fix/gnuexts/SEC104___builtin_choose_expr.hss 2003-09-16 22:56:06.000000000 +0200
  235. @@ -2,7 +2,9 @@
  236. Title=__builtin_choose_expr
  237. [Top]
  238. -You can use the built-in function <CODE>__builtin_choose_expr</CODE> to
  239. +<CODE><I>type</I> __builtin_choose_expr (const_exp, exp1, exp2);</CODE>
  240. +<BR><BR>
  241. +You can use the built-in function __builtin_choose_expr to
  242. evaluate code depending on the value of a constant expression. This
  243. built-in function returns <I>exp1</I> if <I>const_exp</I>, which is a
  244. constant expression that must be able to be determined at compile time,
  245. @@ -33,7 +35,7 @@
  246. when assigning the result to something. */ \
  247. (void)0))
  248. </PRE>
  249. -<I>Note:</I> This construct is only available for C. Furthermore, the
  250. +<B>Note:</B> The
  251. unused expression (<I>exp1</I> or <I>exp2</I> depending on the value of
  252. <I>const_exp</I>) may still generate syntax errors. This may change in
  253. future revisions.
  254. diff -Nur gnuexts/SEC104___builtin_constant_p.hss fix/gnuexts/SEC104___builtin_constant_p.hss
  255. --- gnuexts/SEC104___builtin_constant_p.hss 2003-09-16 16:47:46.000000000 +0200
  256. +++ fix/gnuexts/SEC104___builtin_constant_p.hss 2003-09-16 22:56:06.000000000 +0200
  257. @@ -2,6 +2,8 @@
  258. Title=__builtin_constant_p
  259. [Top]
  260. +<CODE><B><A HREF="$$INFOLINK(keywords/int)">int</A></B> __builtin_constant_p (exp);</CODE>
  261. +<BR><BR>
  262. You can use the built-in function <CODE>__builtin_constant_p</CODE> to
  263. determine if a value is known to be constant at compile-time and hence
  264. that GCC can perform constant-folding on expressions involving that
  265. @@ -12,8 +14,7 @@
  266. but merely that GCC cannot prove it is a constant with the specified
  267. value of the <B>'-O'</B> option.
  268. <BR><BR>
  269. -You would typically use this function in an embedded application where
  270. -memory was a critical resource. If you have some complex calculation,
  271. +If you have some complex calculation,
  272. you may want it to be folded if it involves constants, but need to call
  273. a function if it does not. For example:
  274. <PRE>#define Scale_Value(X) \
  275. diff -Nur gnuexts/SEC104___builtin_expect.hss fix/gnuexts/SEC104___builtin_expect.hss
  276. --- gnuexts/SEC104___builtin_expect.hss 2003-09-16 16:47:46.000000000 +0200
  277. +++ fix/gnuexts/SEC104___builtin_expect.hss 2003-09-16 22:56:06.000000000 +0200
  278. @@ -2,12 +2,10 @@
  279. Title=__builtin_expect
  280. [Top]
  281. +<CODE><B><A HREF="$$INFOLINK(keywords/long)">long</A></B> __builtin_expect (<B><A HREF="$$INFOLINK(keywords/long)">long</A></B> exp, <B><A HREF="$$INFOLINK(keywords/long)">long</A></B> c);</CODE>
  282. +<BR><BR>
  283. You may use <CODE>__builtin_expect</CODE> to provide the compiler with
  284. -branch prediction information. In general, you should prefer to
  285. -use actual profile feedback for this (<B>'-fprofile-arcs'</B>), as
  286. -programmers are notoriously bad at predicting how their programs
  287. -actually perform. However, there are applications in which this
  288. -data is hard to collect.
  289. +branch prediction information.
  290. <BR><BR>
  291. The return value is the value of <I>exp</I>, which should be an
  292. integral expression. The value of <I>c</I> must be a compile-time
  293. diff -Nur gnuexts/SEC104___builtin_huge_val.hss fix/gnuexts/SEC104___builtin_huge_val.hss
  294. --- gnuexts/SEC104___builtin_huge_val.hss 2003-09-16 16:47:46.000000000 +0200
  295. +++ fix/gnuexts/SEC104___builtin_huge_val.hss 1970-01-01 01:00:00.000000000 +0100
  296. @@ -1,7 +0,0 @@
  297. -[Main]
  298. -Title=__builtin_huge_val
  299. -
  300. -[Top]
  301. -Returns a positive infinity, if supported by the floating-point format,
  302. -else <CODE>DBL_MAX</CODE>. This function is suitable for implementing the
  303. -ISO C macro <CODE>HUGE_VAL</CODE>.
  304. diff -Nur gnuexts/SEC104___builtin_huge_valf.hss fix/gnuexts/SEC104___builtin_huge_valf.hss
  305. --- gnuexts/SEC104___builtin_huge_valf.hss 2003-09-16 16:47:46.000000000 +0200
  306. +++ fix/gnuexts/SEC104___builtin_huge_valf.hss 1970-01-01 01:00:00.000000000 +0100
  307. @@ -1,5 +0,0 @@
  308. -[Main]
  309. -Title=__builtin_huge_valf
  310. -
  311. -[Top]
  312. -Similar to <CODE>__builtin_huge_val</CODE>, except the return type is <CODE>float</CODE>.
  313. diff -Nur gnuexts/SEC104___builtin_huge_vall.hss fix/gnuexts/SEC104___builtin_huge_vall.hss
  314. --- gnuexts/SEC104___builtin_huge_vall.hss 2003-09-16 16:47:46.000000000 +0200
  315. +++ fix/gnuexts/SEC104___builtin_huge_vall.hss 1970-01-01 01:00:00.000000000 +0100
  316. @@ -1,6 +0,0 @@
  317. -[Main]
  318. -Title=__builtin_huge_vall
  319. -
  320. -[Top]
  321. -Similar to <CODE>__builtin_huge_val</CODE>, except the return
  322. -type is <CODE>long&nbsp;double</CODE>.
  323. diff -Nur gnuexts/SEC104___builtin_inf.hss fix/gnuexts/SEC104___builtin_inf.hss
  324. --- gnuexts/SEC104___builtin_inf.hss 2003-09-16 16:47:46.000000000 +0200
  325. +++ fix/gnuexts/SEC104___builtin_inf.hss 1970-01-01 01:00:00.000000000 +0100
  326. @@ -1,7 +0,0 @@
  327. -[Main]
  328. -Title=__builtin_inf
  329. -
  330. -[Top]
  331. -Similar to <CODE>__builtin_huge_val</CODE>, except a warning is generated
  332. -if the target floating-point format does not support infinities.
  333. -This function is suitable for implementing the ISO C99 macro <CODE>INFINITY</CODE>.
  334. diff -Nur gnuexts/SEC104___builtin_inff.hss fix/gnuexts/SEC104___builtin_inff.hss
  335. --- gnuexts/SEC104___builtin_inff.hss 2003-09-16 16:47:46.000000000 +0200
  336. +++ fix/gnuexts/SEC104___builtin_inff.hss 1970-01-01 01:00:00.000000000 +0100
  337. @@ -1,5 +0,0 @@
  338. -[Main]
  339. -Title=__builtin_inff
  340. -
  341. -[Top]
  342. -Similar to <CODE>__builtin_inf</CODE>, except the return type is <CODE>float</CODE>.
  343. diff -Nur gnuexts/SEC104___builtin_infl.hss fix/gnuexts/SEC104___builtin_infl.hss
  344. --- gnuexts/SEC104___builtin_infl.hss 2003-09-16 16:47:46.000000000 +0200
  345. +++ fix/gnuexts/SEC104___builtin_infl.hss 1970-01-01 01:00:00.000000000 +0100
  346. @@ -1,6 +0,0 @@
  347. -[Main]
  348. -Title=__builtin_infl
  349. -
  350. -[Top]
  351. -Similar to <CODE>__builtin_inf</CODE>, except the return
  352. -type is <CODE>long&nbsp;double</CODE>.
  353. diff -Nur gnuexts/SEC104___builtin_nan.hss fix/gnuexts/SEC104___builtin_nan.hss
  354. --- gnuexts/SEC104___builtin_nan.hss 2003-09-16 16:47:46.000000000 +0200
  355. +++ fix/gnuexts/SEC104___builtin_nan.hss 1970-01-01 01:00:00.000000000 +0100
  356. @@ -1,17 +0,0 @@
  357. -[Main]
  358. -Title=__builtin_nan
  359. -
  360. -[Top]
  361. -This is an implementation of the ISO C99 function <CODE>nan</CODE>.
  362. -<BR><BR>
  363. -Since ISO C99 defines this function in terms of <CODE>strtod</CODE>, which we
  364. -do not implement, a description of the parsing is in order. The string
  365. -is parsed as by <CODE>strtol</CODE>; that is, the base is recognized by
  366. -leading <CODE>0</CODE> or <CODE>0x</CODE> prefixes. The number parsed is placed
  367. -in the significand such that the least significant bit of the number
  368. -is at the least significant bit of the significand. The number is
  369. -truncated to fit the significand field provided. The significand is
  370. -forced to be a quiet NaN.
  371. -<BR><BR>
  372. -This function, if given a string literal, is evaluated early enough
  373. -that it is considered a compile-time constant.
  374. diff -Nur gnuexts/SEC104___builtin_nanf.hss fix/gnuexts/SEC104___builtin_nanf.hss
  375. --- gnuexts/SEC104___builtin_nanf.hss 2003-09-16 16:47:46.000000000 +0200
  376. +++ fix/gnuexts/SEC104___builtin_nanf.hss 1970-01-01 01:00:00.000000000 +0100
  377. @@ -1,5 +0,0 @@
  378. -[Main]
  379. -Title=__builtin_nanf
  380. -
  381. -[Top]
  382. -Similar to <CODE>__builtin_nan</CODE>, except the return type is <CODE>float</CODE>.
  383. diff -Nur gnuexts/SEC104___builtin_nanl.hss fix/gnuexts/SEC104___builtin_nanl.hss
  384. --- gnuexts/SEC104___builtin_nanl.hss 2003-09-16 16:47:46.000000000 +0200
  385. +++ fix/gnuexts/SEC104___builtin_nanl.hss 1970-01-01 01:00:00.000000000 +0100
  386. @@ -1,5 +0,0 @@
  387. -[Main]
  388. -Title=__builtin_nanl
  389. -
  390. -[Top]
  391. -Similar to <CODE>__builtin_nan</CODE>, except the return type is <CODE>long&nbsp;double</CODE>.
  392. diff -Nur gnuexts/SEC104___builtin_nans.hss fix/gnuexts/SEC104___builtin_nans.hss
  393. --- gnuexts/SEC104___builtin_nans.hss 2003-09-16 16:47:46.000000000 +0200
  394. +++ fix/gnuexts/SEC104___builtin_nans.hss 1970-01-01 01:00:00.000000000 +0100
  395. @@ -1,7 +0,0 @@
  396. -[Main]
  397. -Title=__builtin_nans
  398. -
  399. -[Top]
  400. -Similar to <CODE>__builtin_nan</CODE>, except the significand is forced
  401. -to be a signaling NaN. The <CODE>nans</CODE> function is proposed by
  402. -<A HREF="http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n965.htm,,WG14 N965">http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n965.htm,,WG14 N965</A>.
  403. diff -Nur gnuexts/SEC104___builtin_nansf.hss fix/gnuexts/SEC104___builtin_nansf.hss
  404. --- gnuexts/SEC104___builtin_nansf.hss 2003-09-16 16:47:46.000000000 +0200
  405. +++ fix/gnuexts/SEC104___builtin_nansf.hss 1970-01-01 01:00:00.000000000 +0100
  406. @@ -1,5 +0,0 @@
  407. -[Main]
  408. -Title=__builtin_nansf
  409. -
  410. -[Top]
  411. -Similar to <CODE>__builtin_nans</CODE>, except the return type is <CODE>float</CODE>.
  412. diff -Nur gnuexts/SEC104___builtin_nansl.hss fix/gnuexts/SEC104___builtin_nansl.hss
  413. --- gnuexts/SEC104___builtin_nansl.hss 2003-09-16 16:47:46.000000000 +0200
  414. +++ fix/gnuexts/SEC104___builtin_nansl.hss 1970-01-01 01:00:00.000000000 +0100
  415. @@ -1,5 +0,0 @@
  416. -[Main]
  417. -Title=__builtin_nansl
  418. -
  419. -[Top]
  420. -Similar to <CODE>__builtin_nans</CODE>, except the return type is <CODE>long&nbsp;double</CODE>.
  421. diff -Nur gnuexts/SEC104___builtin_prefetch.hss fix/gnuexts/SEC104___builtin_prefetch.hss
  422. --- gnuexts/SEC104___builtin_prefetch.hss 2003-09-16 16:47:46.000000000 +0200
  423. +++ fix/gnuexts/SEC104___builtin_prefetch.hss 2003-09-16 22:56:06.000000000 +0200
  424. @@ -2,39 +2,9 @@
  425. Title=__builtin_prefetch
  426. [Top]
  427. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> __builtin_prefetch (<B><A HREF="$$INFOLINK(keywords/const)">const</A></B> <B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *addr, ...);</CODE>
  428. +<BR><BR>
  429. This function is used to minimize cache-miss latency by moving data into
  430. a cache before it is accessed.
  431. -You can insert calls to <CODE>__builtin_prefetch</CODE> into code for which
  432. -you know addresses of data in memory that is likely to be accessed soon.
  433. -If the target supports them, data prefetch instructions will be generated.
  434. -If the prefetch is done early enough before the access then the data will
  435. -be in the cache by the time it is accessed.
  436. -<BR><BR>
  437. -The value of <I>addr</I> is the address of the memory to prefetch.
  438. -There are two optional arguments, <I>rw</I> and <I>locality</I>.
  439. -The value of <I>rw</I> is a compile-time constant one or zero; one
  440. -means that the prefetch is preparing for a write to the memory address
  441. -and zero, the default, means that the prefetch is preparing for a read.
  442. -The value <I>locality</I> must be a compile-time constant integer between
  443. -zero and three. A value of zero means that the data has no temporal
  444. -locality, so it need not be left in the cache after the access. A value
  445. -of three means that the data has a high degree of temporal locality and
  446. -should be left in all levels of cache possible. Values of one and two
  447. -mean, respectively, a low or moderate degree of temporal locality. The
  448. -default is three.
  449. -<PRE>for (i = 0; i &lt; n; i++)
  450. - {
  451. - a[i] = a[i] + b[i];
  452. - __builtin_prefetch (&amp;a[i+j], 1, 1);
  453. - __builtin_prefetch (&amp;b[i+j], 0, 1);
  454. - /* ... */
  455. - }
  456. -</PRE>
  457. -Data prefetch does not generate faults if <I>addr</I> is invalid, but
  458. -the address expression itself must be valid. For example, a prefetch
  459. -of <CODE>p-&gt;next</CODE> will not fault if <CODE>p-&gt;next</CODE> is not a valid
  460. -address, but evaluation will fault if <CODE>p</CODE> is not a valid address.
  461. -<BR><BR>
  462. -If the target does not support data prefetch, the address expression
  463. -is evaluated if it includes side effects but no other code is generated
  464. -and GCC does not issue a warning.
  465. +As the Motorola 68000 processor does not have any data prefetch instruction,
  466. +this function is not useful in TIGCC.
  467. diff -Nur gnuexts/SEC104___builtin_types_compatible_p.hss fix/gnuexts/SEC104___builtin_types_compatible_p.hss
  468. --- gnuexts/SEC104___builtin_types_compatible_p.hss 2003-09-16 16:47:44.000000000 +0200
  469. +++ fix/gnuexts/SEC104___builtin_types_compatible_p.hss 2003-09-16 22:56:06.000000000 +0200
  470. @@ -2,7 +2,9 @@
  471. Title=__builtin_types_compatible_p
  472. [Top]
  473. -You can use the built-in function <CODE>__builtin_types_compatible_p</CODE> to
  474. +<CODE><B><A HREF="$$INFOLINK(keywords/int)">int</A></B> __builtin_types_compatible_p (type1, type2);</CODE>
  475. +<BR><BR>
  476. +You can use the built-in function __builtin_types_compatible_p to
  477. determine whether two types are the same.
  478. <BR><BR>
  479. This built-in function returns 1 if the unqualified versions of the
  480. @@ -10,26 +12,26 @@
  481. compatible, 0 otherwise. The result of this built-in function can be
  482. used in integer constant expressions.
  483. <BR><BR>
  484. -This built-in function ignores top level qualifiers (e.g., <CODE>const</CODE>,
  485. -<CODE>volatile</CODE>). For example, <CODE>int</CODE> is equivalent to <CODE>const
  486. -int</CODE>.
  487. -<BR><BR>
  488. -The type <CODE>int[]</CODE> and <CODE>int[5]</CODE> are compatible. On the other
  489. -hand, <CODE>int</CODE> and <CODE>char&nbsp;*</CODE> are not compatible, even if the size
  490. -of their types, on the particular architecture are the same. Also, the
  491. +This built-in function ignores top level qualifiers (<CODE><A HREF="$$INFOLINK(keywords/const)">const</A></CODE>,
  492. +<CODE><A HREF="$$INFOLINK(keywords/volatile)">volatile</A></CODE>, etc.). For example, <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE> is equivalent to <CODE><A HREF="$$INFOLINK(keywords/const)">const</A>
  493. +<A HREF="$$INFOLINK(keywords/int)">int</A></CODE>.
  494. +<BR><BR>
  495. +The type <CODE><A HREF="$$INFOLINK(keywords/int)">int</A>[]</CODE> and <CODE><A HREF="$$INFOLINK(keywords/int)">int</A>[5]</CODE> are compatible. On the other
  496. +hand, <CODE><A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE> and <CODE><A HREF="$$INFOLINK(keywords/char)">char</A>*</CODE> are not compatible,
  497. +although their sizes are the same. Also, the
  498. amount of pointer indirection is taken into account when determining
  499. -similarity. Consequently, <CODE>short&nbsp;*</CODE> is not similar to
  500. -<CODE>short&nbsp;**</CODE>. Furthermore, two types that are typedefed are
  501. +similarity. Consequently, <CODE><A HREF="$$INFOLINK(keywords/short)">short</A>*</CODE> is not similar to
  502. +<CODE><A HREF="$$INFOLINK(keywords/short)">short</A>**</CODE>. Furthermore, two types that are typedefed are
  503. considered compatible if their underlying types are compatible.
  504. <BR><BR>
  505. -An <CODE>enum</CODE> type is considered to be compatible with another
  506. -<CODE>enum</CODE> type. For example, <CODE>enum&nbsp;{foo,&nbsp;bar}</CODE> is similar to
  507. +An <CODE><A HREF="$$INFOLINK(keywords/enum)">enum</A></CODE> type is considered to be compatible with another
  508. +<CODE><A HREF="$$INFOLINK(keywords/enum)">enum</A></CODE> type. For example, <CODE>enum&nbsp;{foo,&nbsp;bar}</CODE> is similar to
  509. <CODE>enum&nbsp;{hot,&nbsp;dog}</CODE>.
  510. <BR><BR>
  511. You would typically use this function in code whose execution varies
  512. depending on the arguments' types. For example:
  513. <PRE>#define foo(x) \
  514. - ({ \
  515. + ({ \
  516. typeof (x) tmp; \
  517. if (__builtin_types_compatible_p (typeof (x), long double)) \
  518. tmp = foo_long_double (tmp); \
  519. @@ -42,4 +44,3 @@
  520. tmp; \
  521. })
  522. </PRE>
  523. -<I>Note:</I> This construct is only available for C.
  524. diff -Nur gnuexts/SEC106.hss fix/gnuexts/SEC106.hss
  525. --- gnuexts/SEC106.hss 2003-09-16 16:47:24.000000000 +0200
  526. +++ fix/gnuexts/SEC106.hss 2003-09-16 22:56:06.000000000 +0200
  527. @@ -8,5 +8,4 @@
  528. literal, regardless of what form the newline took originally.
  529. <BR><BR>
  530. CPP currently allows such strings in directives as well (other than the
  531. -<CODE>#include</CODE> family). This is deprecated and will eventually be
  532. -removed.
  533. +<CODE>#include</CODE> family).
  534. diff -Nur gnuexts/SEC108.hss fix/gnuexts/SEC108.hss
  535. --- gnuexts/SEC108.hss 2003-09-16 16:47:54.000000000 +0200
  536. +++ fix/gnuexts/SEC108.hss 2003-09-16 22:56:06.000000000 +0200
  537. @@ -1,5 +1,5 @@
  538. [Main]
  539. -Title=Unnamed struct/union fields within structs/unions.
  540. +Title=Unnamed struct/union Fields within structs/unions
  541. [Top]
  542. For compatibility with other compilers, GCC allows you to define
  543. @@ -17,7 +17,7 @@
  544. In this example, the user would be able to access members of the unnamed
  545. union with code like <CODE>foo.b</CODE>. Note that only unnamed structs and
  546. unions are allowed, you may not have, for example, an unnamed
  547. -<CODE>int</CODE>.
  548. +<CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>.
  549. <BR><BR>
  550. You must never create such structures that cause ambiguous field definitions.
  551. For example, this structure:
  552. @@ -28,6 +28,6 @@
  553. };
  554. } foo;
  555. </PRE>
  556. -It is ambiguous which <CODE>a</CODE> is being referred to with <CODE>foo.a</CODE>.
  557. +It is ambiguous which <I>a</I> is being referred to with <CODE>foo.a</CODE>.
  558. Such constructs are not supported and must be avoided. In the future,
  559. such constructs may be detected and treated as compilation errors.
  560. diff -Nur gnuexts/SEC109.hss fix/gnuexts/SEC109.hss
  561. --- gnuexts/SEC109.hss 2003-09-16 16:47:58.000000000 +0200
  562. +++ fix/gnuexts/SEC109.hss 2003-09-16 22:56:06.000000000 +0200
  563. @@ -1,8 +1,8 @@
  564. [Main]
  565. -Title=When is a Volatile Object Accessed?
  566. +Title=Definite Access of Volatile Objects
  567. [Top]
  568. -Both the C and C++ standard have the concept of volatile objects. These
  569. +Both the C and C++ standard have the concept of <A HREF="$$INFOLINK(keywords/volatile)">volatile</A> objects. These
  570. are normally accessed by pointers and used for accessing hardware. The
  571. standards encourage compilers to refrain from optimizations
  572. concerning accesses to volatile objects that it might perform on
  573. @@ -27,7 +27,7 @@
  574. will cause a read of the volatile object pointed to by <I>src</I> and stores the
  575. value into the volatile object pointed to by <I>dst</I>. There is no
  576. guarantee that these reads and writes are atomic, especially for objects
  577. -larger than <CODE>int</CODE>.
  578. +larger than <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>.
  579. <BR><BR>
  580. Less obvious expressions are where something which looks like an access
  581. is used in a void context. An example would be,
  582. @@ -36,32 +36,4 @@
  583. </PRE>
  584. With C, such expressions are rvalues, and as rvalues cause a read of
  585. the object, GCC interprets this as a read of the volatile being pointed
  586. -to. The C++ standard specifies that such expressions do not undergo
  587. -lvalue to rvalue conversion, and that the type of the dereferenced
  588. -object may be incomplete. The C++ standard does not specify explicitly
  589. -that it is this lvalue to rvalue conversion which is responsible for
  590. -causing an access. However, there is reason to believe that it is,
  591. -because otherwise certain simple expressions become undefined. However,
  592. -because it would surprise most programmers, G++ treats dereferencing a
  593. -pointer to volatile object of complete type in a void context as a read
  594. -of the object. When the object has incomplete type, G++ issues a
  595. -warning.
  596. -<PRE>struct S;
  597. -struct T {int m;};
  598. -volatile S *ptr1 = <I>somevalue</I>;
  599. -volatile T *ptr2 = <I>somevalue</I>;
  600. -*ptr1;
  601. -*ptr2;
  602. -</PRE>
  603. -In this example, a warning is issued for <CODE>*ptr1</CODE>, and <CODE>*ptr2</CODE>
  604. -causes a read of the object pointed to. If you wish to force an error on
  605. -the first case, you must force a conversion to rvalue with, for instance
  606. -a static cast, <CODE>static_cast&lt;S&gt;(*ptr1)</CODE>.
  607. -<BR><BR>
  608. -When using a reference to volatile, G++ does not treat equivalent
  609. -expressions as accesses to volatiles, but instead issues a warning that
  610. -no volatile is accessed. The rationale for this is that otherwise it
  611. -becomes difficult to determine where volatile access occur, and not
  612. -possible to ignore the return value from functions returning volatile
  613. -references. Again, if you wish to force a read, cast the reference to
  614. -an rvalue.
  615. +to.
  616. diff -Nur gnuexts/SEC110.hss fix/gnuexts/SEC110.hss
  617. --- gnuexts/SEC110.hss 1970-01-01 01:00:00.000000000 +0100
  618. +++ fix/gnuexts/SEC110.hss 2003-09-16 23:44:02.000000000 +0200
  619. @@ -0,0 +1,18 @@
  620. +[Main]
  621. +Title=Binary Numbers
  622. +
  623. +[Top]
  624. +TIGCC allows you to specify binary numbers by using a <CODE>0b</CODE> prefix. This can be handy
  625. +in many occasions, such as when trying to declare sprites in a way which actually allows you to see
  626. +the picture. For example, the following declaration defines a simple black and white 8x8 diagonal
  627. +cross:
  628. +<PRE>unsigned char cross[8] =
  629. + {0b10000001,
  630. + 0b01000010,
  631. + 0b00100100,
  632. + 0b00011000,
  633. + 0b00011000,
  634. + 0b00100100,
  635. + 0b01000010,
  636. + 0b10000001};
  637. +</PRE>
  638. diff -Nur gnuexts/SEC63.hss fix/gnuexts/SEC63.hss
  639. --- gnuexts/SEC63.hss 2003-09-16 16:47:24.000000000 +0200
  640. +++ fix/gnuexts/SEC63.hss 2003-09-16 23:46:28.000000000 +0200
  641. @@ -20,7 +20,7 @@
  642. The last thing in the compound statement should be an expression
  643. followed by a semicolon; the value of this subexpression serves as the
  644. value of the entire construct. (If you use some other kind of statement
  645. -last within the braces, the construct has type <CODE>void</CODE>, and thus
  646. +last within the braces, the construct has type <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>, and thus
  647. effectively no value.)
  648. <BR><BR>
  649. This feature is especially useful in making macro definitions &quot;safe&quot; (so
  650. @@ -31,7 +31,7 @@
  651. </PRE>
  652. But this definition computes either <I>a</I> or <I>b</I> twice, with bad
  653. results if the operand has side effects. In GNU C, if you know the
  654. -type of the operands (here let's assume <CODE>int</CODE>), you can define
  655. +type of the operands (here let's assume <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>), you can define
  656. the macro safely as follows:
  657. <PRE>#define maxint(a,b) \
  658. ({int _a = (a), _b = (b); _a &gt; _b ? _a : _b; })
  659. @@ -41,29 +41,4 @@
  660. the initial value of a static variable.
  661. <BR><BR>
  662. If you don't know the type of the operand, you can still do this, but you
  663. -must use <CODE>typeof</CODE> (see <A HREF="$$LINK(SEC69)">Typeof</A>).
  664. -<BR><BR>
  665. -Statement expressions are not supported fully in G++, and their fate
  666. -there is unclear. (It is possible that they will become fully supported
  667. -at some point, or that they will be deprecated, or that the bugs that
  668. -are present will continue to exist indefinitely.) Presently, statement
  669. -expressions do not work well as default arguments.
  670. -<BR><BR>
  671. -In addition, there are semantic issues with statement-expressions in
  672. -C++. If you try to use statement-expressions instead of inline
  673. -functions in C++, you may be surprised at the way object destruction is
  674. -handled. For example:
  675. -<PRE>#define foo(a) ({int b = (a); b + 3; })
  676. -</PRE>
  677. -does not work the same way as:
  678. -<PRE>inline int foo(int a) { int b = a; return b + 3; }
  679. -</PRE>
  680. -In particular, if the expression passed into <CODE>foo</CODE> involves the
  681. -creation of temporaries, the destructors for those temporaries will be
  682. -run earlier in the case of the macro than in the case of the function.
  683. -<BR><BR>
  684. -These considerations mean that it is probably a bad idea to use
  685. -statement-expressions of this form in header files that are designed to
  686. -work with C++. (Note that some versions of the GNU C Library contained
  687. -header files using statement-expression that lead to precisely this
  688. -bug.)
  689. +must use <CODE><A HREF="$$LINK(SEC69)">typeof</A></CODE>.
  690. diff -Nur gnuexts/SEC64.hss fix/gnuexts/SEC64.hss
  691. --- gnuexts/SEC64.hss 2003-09-16 16:47:24.000000000 +0200
  692. +++ fix/gnuexts/SEC64.hss 2003-09-16 22:56:08.000000000 +0200
  693. @@ -4,7 +4,7 @@
  694. [Top]
  695. Each statement expression is a scope in which <U>local labels</U> can be
  696. declared. A local label is simply an identifier; you can jump to it
  697. -with an ordinary <CODE>goto</CODE> statement, but only from within the
  698. +with an ordinary <CODE><A HREF="$$INFOLINK(keywords/goto)">goto</A></CODE> statement, but only from within the
  699. statement expression it belongs to.
  700. <BR><BR>
  701. A local label declaration looks like this:
  702. @@ -22,7 +22,7 @@
  703. <CODE><I>label</I>:</CODE>, within the statements of the statement expression.
  704. <BR><BR>
  705. The local label feature is useful because statement expressions are
  706. -often used in macros. If the macro contains nested loops, a <CODE>goto</CODE>
  707. +often used in macros. If the macro contains nested loops, a <CODE><A HREF="$$INFOLINK(keywords/goto)">goto</A></CODE>
  708. can be useful for breaking out of them. However, an ordinary label
  709. whose scope is the whole function cannot be used: if the macro can be
  710. expanded several times in one function, the label will be multiply
  711. diff -Nur gnuexts/SEC65.hss fix/gnuexts/SEC65.hss
  712. --- gnuexts/SEC65.hss 2003-09-16 16:47:24.000000000 +0200
  713. +++ fix/gnuexts/SEC65.hss 2003-09-16 23:49:04.000000000 +0200
  714. @@ -4,20 +4,17 @@
  715. [Top]
  716. You can get the address of a label defined in the current function
  717. (or a containing function) with the unary operator <CODE>&amp;&amp;</CODE>. The
  718. -value has type <CODE>void&nbsp;*</CODE>. This value is a constant and can be used
  719. ++ value has type <CODE><A HREF="$$INFOLINK(keywords/void)">void</A>*</CODE>. This value is a constant and can be used
  720. wherever a constant of that type is valid. For example:
  721. <PRE>void *ptr;
  722. /* ... */
  723. ptr = &amp;&amp;foo;
  724. </PRE>
  725. To use these values, you need to be able to jump to one. This is done
  726. -with the computed goto statement The analogous feature in
  727. -Fortran is called an assigned goto, but that name seems inappropriate in
  728. -C, where one can do more than simply store label addresses in label
  729. -variables., <CODE>goto&nbsp;*<I>exp</I>;</CODE>. For example,
  730. +with the computed goto statement, <CODE><A HREF="$$INFOLINK(keywords/goto)">goto</A>&nbsp;*<I>exp</I>;</CODE>. For example,
  731. <PRE>goto *ptr;
  732. </PRE>
  733. -Any expression of type <CODE>void&nbsp;*</CODE> is allowed.
  734. +Any expression of type <CODE><A HREF="$$INFOLINK(keywords/void)">void</A>*</CODE> is allowed.
  735. <BR><BR>
  736. One way of using these constants is in initializing a static array that
  737. will serve as a jump table:
  738. @@ -30,14 +27,10 @@
  739. indexing in C never does that.
  740. <BR><BR>
  741. Such an array of label values serves a purpose much like that of the
  742. -<CODE>switch</CODE> statement. The <CODE>switch</CODE> statement is cleaner, so
  743. +<CODE><A HREF="$$INFOLINK(keywords/switch)">switch</A></CODE> statement. The <CODE>switch</CODE> statement is cleaner, so
  744. use that rather than an array unless the problem does not fit a
  745. <CODE>switch</CODE> statement very well.
  746. <BR><BR>
  747. -Another use of label values is in an interpreter for threaded code.
  748. -The labels within the interpreter function can be stored in the
  749. -threaded code for super-fast dispatching.
  750. -<BR><BR>
  751. You may not use this mechanism to jump to code in a different function.
  752. If you do that, totally unpredictable things will happen. The best way to
  753. avoid this is to store the label address only in automatic variables and
  754. @@ -48,6 +41,6 @@
  755. &amp;&amp;hack - &amp;&amp;foo };
  756. goto *(&amp;&amp;foo + array[i]);
  757. </PRE>
  758. -This is more friendly to code living in shared libraries, as it reduces
  759. -the number of dynamic relocations that are needed, and by consequence,
  760. -allows the data to be read-only.
  761. +This is more friendly to code living in shared libraries (DLLs), as it reduces
  762. +the number of dynamic relocations that are needed (and, by consequence,
  763. +would allow the data to be read-only).
  764. diff -Nur gnuexts/SEC66.hss fix/gnuexts/SEC66.hss
  765. --- gnuexts/SEC66.hss 2003-09-16 16:47:24.000000000 +0200
  766. +++ fix/gnuexts/SEC66.hss 2003-09-17 00:45:50.000000000 +0200
  767. @@ -3,12 +3,15 @@
  768. [Top]
  769. A <U>nested function</U> is a function defined inside another function.
  770. -(Nested functions are not supported for GNU C++.) The nested function's
  771. +The nested function's
  772. name is local to the block where it is defined. For example, here we
  773. define a nested function named <CODE>square</CODE>, and call it twice:
  774. -<PRE>foo (double a, double b)
  775. +<PRE>double square_sum (double a, double b)
  776. {
  777. - double square (double z) { return z * z; }
  778. + double square (double z)
  779. + {
  780. + return z * z;
  781. + }
  782. return square (a) + square (b);
  783. }
  784. @@ -17,10 +20,13 @@
  785. function that are visible at the point of its definition. This is
  786. called <U>lexical scoping</U>. For example, here we show a nested
  787. function which uses an inherited variable named <CODE>offset</CODE>:
  788. -<PRE>bar (int *array, int offset, int size)
  789. +<PRE>int foo (int *array, int offset, int size)
  790. {
  791. int access (int *array, int index)
  792. - { return array[index + offset]; }
  793. + {
  794. + return array[index + offset];
  795. + }
  796. +
  797. int i;
  798. /* ... */
  799. for (i = 0; i &lt; size; i++)
  800. @@ -33,10 +39,12 @@
  801. <BR><BR>
  802. It is possible to call the nested function from outside the scope of its
  803. name by storing its address or passing the address to another function:
  804. -<PRE>hack (int *array, int size)
  805. +<PRE>int hack (int *array, int size)
  806. {
  807. void store (int index, int value)
  808. - { array[index] = value; }
  809. + {
  810. + array[index] = value;
  811. + }
  812. intermediate (store, size);
  813. }
  814. @@ -56,16 +64,17 @@
  815. safe.
  816. <BR><BR>
  817. GCC implements taking the address of a nested function using a technique
  818. -called <U>trampolines</U>. A paper describing them is available as
  819. -<BR><BR>
  820. -See <A HREF="http://people.debian.org/~aaronl/Usenix88-lexic.pdf">http://people.debian.org/~aaronl/Usenix88-lexic.pdf</A>.
  821. +called <U>trampolines</U>. A paper describing them is available at
  822. +<A HREF="http://people.debian.org/~aaronl/Usenix88-lexic.pdf">http://people.debian.org/~aaronl/Usenix88-lexic.pdf</A>.
  823. +Note that trampolines are currently broken in TIGCC; they create code on the
  824. +stack, which can make HW2 calculators crash.
  825. <BR><BR>
  826. A nested function can jump to a label inherited from a containing
  827. function, provided the label was explicitly declared in the containing
  828. function (see <A HREF="$$LINK(SEC64)">Local Labels</A>). Such a jump returns instantly to the
  829. containing function, exiting the nested function which did the
  830. -<CODE>goto</CODE> and any intermediate functions as well. Here is an example:
  831. -<PRE>bar (int *array, int offset, int size)
  832. +<CODE><A HREF="$$INFOLINK(keywords/goto)">goto</A></CODE> and any intermediate functions as well. Here is an example:
  833. +<PRE>int bar (int *array, int offset, int size)
  834. {
  835. __label__ failure;
  836. int access (int *array, int index)
  837. @@ -81,7 +90,7 @@
  838. /* ... */
  839. return 0;
  840. - /* Control comes here from <CODE>access</CODE>
  841. + /* Control comes here from 'access'
  842. if it detects an error. */
  843. failure:
  844. return -1;
  845. @@ -89,9 +98,9 @@
  846. </PRE>
  847. A nested function always has internal linkage. Declaring one with
  848. <CODE>extern</CODE> is erroneous. If you need to declare the nested function
  849. -before its definition, use <CODE>auto</CODE> (which is otherwise meaningless
  850. +before its definition, use <CODE><A HREF="$$INFOLINK(keywords/auto)">auto</A></CODE> (which is otherwise meaningless
  851. for function declarations).
  852. -<PRE>bar (int *array, int offset, int size)
  853. +<PRE>int bar (int *array, int offset, int size)
  854. {
  855. __label__ failure;
  856. auto int access (int *, int);
  857. diff -Nur gnuexts/SEC67.hss fix/gnuexts/SEC67.hss
  858. --- gnuexts/SEC67.hss 2003-09-16 16:47:24.000000000 +0200
  859. +++ fix/gnuexts/SEC67.hss 2003-09-16 22:56:08.000000000 +0200
  860. @@ -1,5 +1,6 @@
  861. [Main]
  862. Title=Constructing Function Calls
  863. +Subsections=SEC67___builtin_apply_args, SEC67___builtin_apply, SEC67___builtin_return
  864. [Top]
  865. Using the built-in functions described below, you can record
  866. diff -Nur gnuexts/SEC67___builtin_apply.hss fix/gnuexts/SEC67___builtin_apply.hss
  867. --- gnuexts/SEC67___builtin_apply.hss 2003-09-16 16:47:24.000000000 +0200
  868. +++ fix/gnuexts/SEC67___builtin_apply.hss 2003-09-16 22:56:08.000000000 +0200
  869. @@ -2,12 +2,15 @@
  870. Title=__builtin_apply
  871. [Top]
  872. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *__builtin_apply (<B><A HREF="$$INFOLINK(keywords/void)">void</A></B> (*fnc)(), <B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *args, <B><A HREF="$$INFOLINK(keywords/int)">int</A></B> size);</CODE>
  873. +<BR><BR>
  874. This built-in function invokes <I>function</I>
  875. with a copy of the parameters described by <I>arguments</I>
  876. and <I>size</I>.
  877. <BR><BR>
  878. The value of <I>arguments</I> should be the value returned by
  879. -<CODE>__builtin_apply_args</CODE>. The argument <I>size</I> specifies the size
  880. +<A HREF="$$LINK(SEC67___builtin_apply_args)">__builtin_apply_args</A>.
  881. +The argument <I>size</I> specifies the size
  882. of the stack argument data, in bytes.
  883. <BR><BR>
  884. This function returns a pointer to data describing
  885. @@ -15,6 +18,6 @@
  886. is saved in a block of memory allocated on the stack.
  887. <BR><BR>
  888. It is not always simple to compute the proper value for <I>size</I>. The
  889. -value is used by <CODE>__builtin_apply</CODE> to compute the amount of data
  890. +value is used by __builtin_apply to compute the amount of data
  891. that should be pushed on the stack and copied from the incoming argument
  892. area.
  893. diff -Nur gnuexts/SEC67___builtin_apply_args.hss fix/gnuexts/SEC67___builtin_apply_args.hss
  894. --- gnuexts/SEC67___builtin_apply_args.hss 2003-09-16 16:47:24.000000000 +0200
  895. +++ fix/gnuexts/SEC67___builtin_apply_args.hss 2003-09-16 22:56:08.000000000 +0200
  896. @@ -2,6 +2,8 @@
  897. Title=__builtin_apply_args
  898. [Top]
  899. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *__builtin_apply_args (<B><A HREF="$$INFOLINK(keywords/void)">void</A></B>);</CODE>
  900. +<BR><BR>
  901. This built-in function returns a pointer to data
  902. describing how to perform a call with the same arguments as were passed
  903. to the current function.
  904. diff -Nur gnuexts/SEC67___builtin_return.hss fix/gnuexts/SEC67___builtin_return.hss
  905. --- gnuexts/SEC67___builtin_return.hss 2003-09-16 16:47:24.000000000 +0200
  906. +++ fix/gnuexts/SEC67___builtin_return.hss 2003-09-16 22:56:08.000000000 +0200
  907. @@ -2,6 +2,8 @@
  908. Title=__builtin_return
  909. [Top]
  910. +<CODE><B><A HREF="$$INFOLINK(keywords/void)">void</A></B> __builtin_return (<B><A HREF="$$INFOLINK(keywords/void)">void</A></B> *result);</CODE>
  911. +<BR><BR>
  912. This built-in function returns the value described by <I>result</I> from
  913. the containing function. You should specify, for <I>result</I>, a value
  914. -returned by <CODE>__builtin_apply</CODE>.
  915. +returned by <A HREF="$$LINK(SEC67___builtin_apply)">__builtin_apply</A>.
  916. diff -Nur gnuexts/SEC69.hss fix/gnuexts/SEC69.hss
  917. --- gnuexts/SEC69.hss 2003-09-16 16:47:24.000000000 +0200
  918. +++ fix/gnuexts/SEC69.hss 2003-09-17 00:42:10.000000000 +0200
  919. @@ -1,30 +1,30 @@
  920. [Main]
  921. -Title=Referring to a Type with @code{typeof}
  922. +Title=Referring to a Type with 'typeof'
  923. +Index=typeof, __typeof__
  924. [Top]
  925. Another way to refer to the type of an expression is with <CODE>typeof</CODE>.
  926. -The syntax of using of this keyword looks like <CODE>sizeof</CODE>, but the
  927. -construct acts semantically like a type name defined with <CODE>typedef</CODE>.
  928. +The syntax of using of this keyword looks like <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE>, but the
  929. +construct acts semantically like a type name defined with <CODE><A HREF="$$INFOLINK(keywords/typedef)">typedef</A></CODE>.
  930. <BR><BR>
  931. There are two ways of writing the argument to <CODE>typeof</CODE>: with an
  932. expression or with a type. Here is an example with an expression:
  933. <PRE>typeof (x[0](1))
  934. </PRE>
  935. -This assumes that <CODE>x</CODE> is an array of pointers to functions;
  936. +This assumes that <I>x</I> is an array of pointers to functions;
  937. the type described is that of the values of the functions.
  938. <BR><BR>
  939. Here is an example with a typename as the argument:
  940. <PRE>typeof (int *)
  941. </PRE>
  942. -Here the type described is that of pointers to <CODE>int</CODE>.
  943. +Here the type described is that of pointers to <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>.
  944. <BR><BR>
  945. -If you are writing a header file that must work when included in ISO C
  946. -programs, write <CODE>__typeof__</CODE> instead of <CODE>typeof</CODE>.
  947. +An alternate keyword for <CODE>typeof</CODE> is <CODE>__typeof__</CODE>.
  948. See <A HREF="$$LINK(SEC100)">Alternate Keywords</A>.
  949. <BR><BR>
  950. A <CODE>typeof</CODE>-construct can be used anywhere a typedef name could be
  951. used. For example, you can use it in a declaration, in a cast, or inside
  952. -of <CODE>sizeof</CODE> or <CODE>typeof</CODE>.
  953. +of <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE> or <CODE>typeof</CODE>.
  954. <BR><BR>
  955. <CODE>typeof</CODE> is often useful in conjunction with the
  956. statements-within-expressions feature. Here is how the two together can
  957. @@ -45,17 +45,17 @@
  958. Some more examples of the use of <CODE>typeof</CODE>:
  959. <UL>
  960. <LI>
  961. -This declares <CODE>y</CODE> with the type of what <CODE>x</CODE> points to.
  962. +This declares <I>y</I> with the type of what <I>x</I> points to.
  963. <PRE>typeof (*x) y;
  964. </PRE>
  965. </LI>
  966. <LI>
  967. -This declares <CODE>y</CODE> as an array of such values.
  968. +This declares <I>y</I> as an array of such values.
  969. <PRE>typeof (*x) y[4];
  970. </PRE>
  971. </LI>
  972. <LI>
  973. -This declares <CODE>y</CODE> as an array of pointers to characters:
  974. +This declares <I>y</I> as an array of pointers to characters:
  975. <PRE>typeof (typeof (char *)[4]) y;
  976. </PRE>
  977. It is equivalent to the following traditional C declaration:
  978. @@ -63,7 +63,7 @@
  979. </PRE>
  980. To see the meaning of the declaration using <CODE>typeof</CODE>, and why it
  981. might be a useful way to write, let's rewrite it with these macros:
  982. -<PRE>#define pointer(T) typeof(T *)
  983. +<PRE>#define pointer(T) typeof(T *)
  984. #define array(T, N) typeof(T [N])
  985. </PRE>
  986. Now the declaration can be rewritten this way:
  987. diff -Nur gnuexts/SEC70.hss fix/gnuexts/SEC70.hss
  988. --- gnuexts/SEC70.hss 2003-09-16 16:47:24.000000000 +0200
  989. +++ fix/gnuexts/SEC70.hss 2003-09-16 22:56:08.000000000 +0200
  990. @@ -6,10 +6,6 @@
  991. lvalues provided their operands are lvalues. This means that you can take
  992. their addresses or store values into them.
  993. <BR><BR>
  994. -Standard C++ allows compound expressions and conditional expressions as
  995. -lvalues, and permits casts to reference type, so use of this extension
  996. -is deprecated for C++ code.
  997. -<BR><BR>
  998. For example, a compound expression can be assigned, provided the last
  999. expression in the sequence is an lvalue. These two expressions are
  1000. equivalent:
  1001. @@ -32,7 +28,7 @@
  1002. right-hand side first to the specified type, then to the type of the
  1003. inner left-hand side expression. After this is stored, the value is
  1004. converted back to the specified type to become the value of the
  1005. -assignment. Thus, if <CODE>a</CODE> has type <CODE>char&nbsp;*</CODE>, the following two
  1006. +assignment. Thus, if <CODE>a</CODE> has type <CODE><A HREF="$$INFOLINK(keywords/char)">char</A>*</CODE>, the following two
  1007. expressions are equivalent:
  1008. <PRE>(int)a = 5
  1009. (int)(a = (char *)(int)5)
  1010. @@ -46,14 +42,14 @@
  1011. </PRE>
  1012. You cannot take the address of an lvalue cast, because the use of its
  1013. address would not work out coherently. Suppose that <CODE>&amp;(int)f</CODE> were
  1014. -permitted, where <CODE>f</CODE> has type <CODE>float</CODE>. Then the following
  1015. +permitted, where <CODE>f</CODE> has type <CODE><A HREF="$$INFOLINK(keywords/float)">float</A></CODE>. Then the following
  1016. statement would try to store an integer bit-pattern where a floating
  1017. point number belongs:
  1018. <PRE>*&amp;(int)f = 1;
  1019. </PRE>
  1020. This is quite different from what <CODE>(int)f&nbsp;=&nbsp;1</CODE> would do - that
  1021. would convert 1 to floating point and store it. Rather than cause this
  1022. -inconsistency, we think it is better to prohibit use of <CODE>&amp;</CODE> on a cast.
  1023. +inconsistency, the GNU team thinks it is better to prohibit use of <CODE>&amp;</CODE> on a cast.
  1024. <BR><BR>
  1025. -If you really do want an <CODE>int&nbsp;*</CODE> pointer with the address of
  1026. -<CODE>f</CODE>, you can simply write <CODE>(int&nbsp;*)&amp;f</CODE>.
  1027. +If you really do want an <CODE><A HREF="$$INFOLINK(keywords/int)">int</A>*</CODE> pointer with the address of
  1028. +<CODE>f</CODE>, you can simply write <CODE>(int*)&amp;f</CODE>.
  1029. diff -Nur gnuexts/SEC72.hss fix/gnuexts/SEC72.hss
  1030. --- gnuexts/SEC72.hss 2003-09-16 16:47:24.000000000 +0200
  1031. +++ fix/gnuexts/SEC72.hss 2003-09-16 22:56:08.000000000 +0200
  1032. @@ -3,25 +3,23 @@
  1033. [Top]
  1034. ISO C99 supports data types for integers that are at least 64 bits wide,
  1035. -and as an extension GCC supports them in C89 mode and in C++.
  1036. -Simply write <CODE>long&nbsp;long&nbsp;int</CODE> for a signed integer, or
  1037. -<CODE>unsigned&nbsp;long&nbsp;long&nbsp;int</CODE> for an unsigned integer. To make an
  1038. +and as an extension GCC supports them in C89 mode.
  1039. +Simply write <CODE><A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE> for a signed integer, or
  1040. +<CODE><A HREF="$$INFOLINK(keywords/unsigned)">unsigned</A>&nbsp;<A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE> for an unsigned integer. To make an
  1041. integer constant of type <CODE>long&nbsp;long&nbsp;int</CODE>, add the suffix <CODE>LL</CODE>
  1042. to the integer. To make an integer constant of type <CODE>unsigned&nbsp;long
  1043. long&nbsp;int</CODE>, add the suffix <CODE>ULL</CODE> to the integer.
  1044. <BR><BR>
  1045. You can use these types in arithmetic like any other integer types.
  1046. Addition, subtraction, and bitwise boolean operations on these types
  1047. -are open-coded on all types of machines. Multiplication is open-coded
  1048. -if the machine supports fullword-to-doubleword a widening multiply
  1049. -instruction. Division and shifts are open-coded only on machines that
  1050. -provide special support. The operations that are not open-coded use
  1051. -special library routines that come with GCC.
  1052. +are open-coded on all types of machines, as well as shifts with a constant
  1053. +value. Multiplication, division and shifts are not open-coded and use
  1054. +special library routines.
  1055. <BR><BR>
  1056. There may be pitfalls when you use <CODE>long&nbsp;long</CODE> types for function
  1057. arguments, unless you declare function prototypes. If a function
  1058. -expects type <CODE>int</CODE> for its argument, and you pass a value of type
  1059. -<CODE>long&nbsp;long&nbsp;int</CODE>, confusion will result because the caller and the
  1060. +expects type <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE> for its argument, and you pass a value of type
  1061. +<CODE><A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE>, confusion will result because the caller and the
  1062. subroutine will disagree about the number of bytes for the argument.
  1063. -Likewise, if the function expects <CODE>long&nbsp;long&nbsp;int</CODE> and you pass
  1064. -<CODE>int</CODE>. The best way to avoid such problems is to use prototypes.
  1065. +Likewise, if the function expects <CODE><A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/long)">long</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE> and you pass
  1066. +<CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>. The best way to avoid such problems is to use prototypes.
  1067. diff -Nur gnuexts/SEC73.hss fix/gnuexts/SEC73.hss
  1068. --- gnuexts/SEC73.hss 2003-09-16 16:47:24.000000000 +0200
  1069. +++ fix/gnuexts/SEC73.hss 2003-09-17 00:49:36.000000000 +0200
  1070. @@ -1,17 +1,18 @@
  1071. [Main]
  1072. Title=Complex Numbers
  1073. +Index=__complex__, __imag__, __real__, _Complex
  1074. [Top]
  1075. ISO C99 supports complex floating data types, and as an extension GCC
  1076. -supports them in C89 mode and in C++, and supports complex integer data
  1077. +supports them in C89 mode, and supports complex integer data
  1078. types which are not part of ISO C99. You can declare complex types
  1079. using the keyword <CODE>_Complex</CODE>. As an extension, the older GNU
  1080. keyword <CODE>__complex__</CODE> is also supported.
  1081. <BR><BR>
  1082. For example, <CODE>_Complex&nbsp;double&nbsp;x;</CODE> declares <CODE>x</CODE> as a
  1083. variable whose real part and imaginary part are both of type
  1084. -<CODE>double</CODE>. <CODE>_Complex&nbsp;short&nbsp;int&nbsp;y;</CODE> declares <CODE>y</CODE> to
  1085. -have real and imaginary parts of type <CODE>short&nbsp;int</CODE>; this is not
  1086. +<CODE><A HREF="$$INFOLINK(keywords/double)">double</A></CODE>. <CODE>_Complex&nbsp;short&nbsp;int&nbsp;y;</CODE> declares <CODE>y</CODE> to
  1087. +have real and imaginary parts of type <CODE><A HREF="$$INFOLINK(keywords/short)">short</A>&nbsp;<A HREF="$$INFOLINK(keywords/int)">int</A></CODE>; this is not
  1088. likely to be useful, but it shows that the set of complex types is
  1089. complete.
  1090. <BR><BR>
  1091. @@ -20,9 +21,7 @@
  1092. has type <CODE>_Complex&nbsp;float</CODE> and <CODE>3i</CODE> has type
  1093. <CODE>_Complex&nbsp;int</CODE>. Such a constant always has a pure imaginary
  1094. value, but you can form any complex value you like by adding one to a
  1095. -real constant. This is a GNU extension; if you have an ISO C99
  1096. -conforming C library (such as GNU libc), and want to construct complex
  1097. -constants of floating type, you should include <CODE>&lt;complex.h&gt;</CODE> and
  1098. +real constant. This is a GNU extension; once TIGCC supports this, you should include <CODE>&lt;complex.h&gt;</CODE> and
  1099. use the macros <CODE>I</CODE> or <CODE>_Complex_I</CODE> instead.
  1100. <BR><BR>
  1101. To extract the real part of a complex-valued expression <I>exp</I>, write
  1102. @@ -30,7 +29,7 @@
  1103. extract the imaginary part. This is a GNU extension; for values of
  1104. floating type, you should use the ISO C99 functions <CODE>crealf</CODE>,
  1105. <CODE>creal</CODE>, <CODE>creall</CODE>, <CODE>cimagf</CODE>, <CODE>cimag</CODE> and
  1106. -<CODE>cimagl</CODE>, declared in <CODE>&lt;complex.h&gt;</CODE> and also provided as
  1107. +<CODE>cimagl</CODE>, declared in <CODE>&lt;complex.h&gt;</CODE> (not yet available in TIGCC) and also provided as
  1108. built-in functions by GCC.
  1109. <BR><BR>
  1110. The operator <CODE>~</CODE> performs complex conjugation when used on a value
  1111. @@ -41,10 +40,4 @@
  1112. <BR><BR>
  1113. GCC can allocate complex automatic variables in a noncontiguous
  1114. fashion; it's even possible for the real part to be in a register while
  1115. -the imaginary part is on the stack (or vice-versa). Only the DWARF2
  1116. -debug info format can represent this, so use of DWARF2 is recommended.
  1117. -If you are using the stabs debug info format, GCC describes a noncontiguous
  1118. -complex variable as if it were two separate variables of noncomplex type.
  1119. -If the variable's actual name is <CODE>foo</CODE>, the two fictitious
  1120. -variables are named <CODE>foo$real</CODE> and <CODE>foo$imag</CODE>. You can
  1121. -examine and set these two fictitious variables with your debugger.
  1122. +the imaginary part is on the stack (or vice-versa).
  1123. diff -Nur gnuexts/SEC74.hss fix/gnuexts/SEC74.hss
  1124. --- gnuexts/SEC74.hss 2003-09-16 16:47:24.000000000 +0200
  1125. +++ fix/gnuexts/SEC74.hss 2003-09-16 22:56:08.000000000 +0200
  1126. @@ -6,11 +6,11 @@
  1127. decimal notation, such as <CODE>1.55e1</CODE>, but also numbers such as
  1128. <CODE>0x1.fp3</CODE> written in hexadecimal format. As a GNU extension, GCC
  1129. supports this in C89 mode (except in some cases when strictly
  1130. -conforming) and in C++. In that format the
  1131. +conforming). In that format the
  1132. <CODE>0x</CODE> hex introducer and the <CODE>p</CODE> or <CODE>P</CODE> exponent field are
  1133. mandatory. The exponent is a decimal number that indicates the power of
  1134. 2 by which the significant part will be multiplied. Thus <CODE>0x1.f</CODE> is
  1135. -1 15/16,
  1136. +<CODE>1&nbsp;15/16</CODE>,
  1137. <CODE>p3</CODE> multiplies it by 8, and the value of <CODE>0x1.fp3</CODE>
  1138. is the same as <CODE>1.55e1</CODE>.
  1139. <BR><BR>
  1140. @@ -18,4 +18,4 @@
  1141. is always required in the hexadecimal notation. Otherwise the compiler
  1142. would not be able to resolve the ambiguity of, e.g., <CODE>0x1.f</CODE>. This
  1143. could mean <CODE>1.0f</CODE> or <CODE>1.9375</CODE> since <CODE>f</CODE> is also the
  1144. -extension for floating-point constants of type <CODE>float</CODE>.
  1145. +extension for floating-point constants of type <CODE><A HREF="$$INFOLINK(keywords/float)">float</A></CODE>.
  1146. diff -Nur gnuexts/SEC75.hss fix/gnuexts/SEC75.hss
  1147. --- gnuexts/SEC75.hss 2003-09-16 16:47:24.000000000 +0200
  1148. +++ fix/gnuexts/SEC75.hss 2003-09-17 00:50:44.000000000 +0200
  1149. @@ -14,8 +14,8 @@
  1150. malloc (sizeof (struct line) + this_length);
  1151. thisline-&gt;length = this_length;
  1152. </PRE>
  1153. -In ISO C90, you would have to give <CODE>contents</CODE> a length of 1, which
  1154. -means either you waste space or complicate the argument to <CODE>malloc</CODE>.
  1155. +In ISO C90, you would have to give <I>contents</I> a length of 1, which
  1156. +means either you waste space or complicate the argument to <A HREF="$$LINK(alloc.h/malloc)">malloc</A>.
  1157. <BR><BR>
  1158. In ISO C99, you would use a <U>flexible array member</U>, which is
  1159. slightly different in syntax and semantics:
  1160. @@ -26,14 +26,14 @@
  1161. <BR><BR>
  1162. </LI>
  1163. <LI>
  1164. -Flexible array members have incomplete type, and so the <CODE>sizeof</CODE>
  1165. +Flexible array members have incomplete type, and so the <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE>
  1166. operator may not be applied. As a quirk of the original implementation
  1167. -of zero-length arrays, <CODE>sizeof</CODE> evaluates to zero.
  1168. +of zero-length arrays, <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE> evaluates to zero.
  1169. <BR><BR>
  1170. </LI>
  1171. <LI>
  1172. Flexible array members may only appear as the last member of a
  1173. -<CODE>struct</CODE> that is otherwise non-empty.
  1174. +<CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A></CODE> that is otherwise non-empty.
  1175. <BR><BR>
  1176. </LI>
  1177. <LI>
  1178. @@ -55,8 +55,8 @@
  1179. Instead GCC allows static initialization of flexible array members.
  1180. This is equivalent to defining a new structure containing the original
  1181. structure followed by an array of sufficient size to contain the data.
  1182. -I.e. in the following, <CODE>f1</CODE> is constructed as if it were declared
  1183. -like <CODE>f2</CODE>.
  1184. +I.e. in the following, <I>f1</I> is constructed as if it were declared
  1185. +like <I>f2</I>.
  1186. <PRE>struct f1 {
  1187. int x; int y[];
  1188. } f1 = { 1, { 2, 3, 4 } };
  1189. @@ -65,8 +65,8 @@
  1190. struct f1 f1; int data[3];
  1191. } f2 = { { 1 }, { 2, 3, 4 } };
  1192. </PRE>
  1193. -The convenience of this extension is that <CODE>f1</CODE> has the desired
  1194. -type, eliminating the need to consistently refer to <CODE>f2.f1</CODE>.
  1195. +The convenience of this extension is that <I>f1</I> has the desired
  1196. +type, eliminating the need to consistently refer to <I>f2</I>.<I>f1</I>.
  1197. <BR><BR>
  1198. This has symmetry with normal static arrays, in that an array of
  1199. unknown size is also written with <CODE>[]</CODE>.
  1200. @@ -83,5 +83,5 @@
  1201. struct foo a = { 1, { 2, 3, 4 } }; // Valid.
  1202. struct bar b = { { 1, { 2, 3, 4 } } }; // Invalid.
  1203. struct bar c = { { 1, { } } }; // Valid.
  1204. -struct foo d[1] = { { 1 { 2, 3, 4 } } }; // Invalid.
  1205. +struct foo d[1] = { { 1, { 2, 3, 4 } } }; // Invalid.
  1206. </PRE>
  1207. diff -Nur gnuexts/SEC76.hss fix/gnuexts/SEC76.hss
  1208. --- gnuexts/SEC76.hss 2003-09-16 16:47:24.000000000 +0200
  1209. +++ fix/gnuexts/SEC76.hss 2003-09-16 22:56:08.000000000 +0200
  1210. @@ -3,15 +3,14 @@
  1211. [Top]
  1212. Variable-length automatic arrays are allowed in ISO C99, and as an
  1213. -extension GCC accepts them in C89 mode and in C++. (However, GCC's
  1214. +extension GCC accepts them in C89 mode. (However, GCC's
  1215. implementation of variable-length arrays does not yet conform in detail
  1216. to the ISO C99 standard.) These arrays are
  1217. declared like any other automatic arrays, but with a length that is not
  1218. a constant expression. The storage is allocated at the point of
  1219. declaration and deallocated when the brace-level is exited. For
  1220. example:
  1221. -<PRE>FILE *
  1222. -concat_fopen (char *s1, char *s2, char *mode)
  1223. +<PRE>FILE *concat_fopen (const char *s1, const char *s2, const char *mode)
  1224. {
  1225. char str[strlen (s1) + strlen (s2) + 1];
  1226. strcpy (str, s1);
  1227. @@ -23,17 +22,17 @@
  1228. storage. Jumping into the scope is not allowed; you get an error
  1229. message for it.
  1230. <BR><BR>
  1231. -You can use the function <CODE>alloca</CODE> to get an effect much like
  1232. -variable-length arrays. The function <CODE>alloca</CODE> is available in
  1233. +You can use the function <A HREF="$$LINK(alloc.h/alloca)">alloca</A> to get an effect much like
  1234. +variable-length arrays. The function <A HREF="$$LINK(alloc.h/alloca)">alloca</A> is available in
  1235. many other C implementations (but not in all). On the other hand,
  1236. variable-length arrays are more elegant.
  1237. <BR><BR>
  1238. There are other differences between these two methods. Space allocated
  1239. -with <CODE>alloca</CODE> exists until the containing <I>function</I> returns.
  1240. +with <A HREF="$$LINK(alloc.h/alloca)">alloca</A> exists until the containing <I>function</I> returns.
  1241. The space for a variable-length array is deallocated as soon as the array
  1242. name's scope ends. (If you use both variable-length arrays and
  1243. -<CODE>alloca</CODE> in the same function, deallocation of a variable-length array
  1244. -will also deallocate anything more recently allocated with <CODE>alloca</CODE>.)
  1245. +<A HREF="$$LINK(alloc.h/alloca)">alloca</A> in the same function, deallocation of a variable-length array
  1246. +will also deallocate anything more recently allocated with <A HREF="$$LINK(alloc.h/alloca)">alloca</A>.)
  1247. <BR><BR>
  1248. You can also use variable-length arrays as arguments to functions:
  1249. <PRE>struct entry
  1250. @@ -44,7 +43,7 @@
  1251. </PRE>
  1252. The length of an array is computed once when the storage is allocated
  1253. and is remembered for the scope of the array in case you access it with
  1254. -<CODE>sizeof</CODE>.
  1255. +<CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE>.
  1256. <BR><BR>
  1257. If you want to pass the array first and the length afterward, you can
  1258. use a forward declaration in the parameter list - another GNU extension.
  1259. @@ -55,8 +54,8 @@
  1260. }
  1261. </PRE>
  1262. The <CODE>int&nbsp;len</CODE> before the semicolon is a <U>parameter forward
  1263. -declaration</U>, and it serves the purpose of making the name <CODE>len</CODE>
  1264. -known when the declaration of <CODE>data</CODE> is parsed.
  1265. +declaration</U>, and it serves the purpose of making the name <I>len</I>
  1266. +known when the declaration of <I>data</I> is parsed.
  1267. <BR><BR>
  1268. You can write any number of such parameter forward declarations in the
  1269. parameter list. They can be separated by commas or semicolons, but the
  1270. diff -Nur gnuexts/SEC77.hss fix/gnuexts/SEC77.hss
  1271. --- gnuexts/SEC77.hss 2003-09-16 16:47:24.000000000 +0200
  1272. +++ fix/gnuexts/SEC77.hss 2003-09-16 22:56:08.000000000 +0200
  1273. @@ -1,23 +1,24 @@
  1274. [Main]
  1275. -Title=Macros with a Variable Number of Arguments.
  1276. +Title=Macros with a Variable Number of Arguments
  1277. [Top]
  1278. In the ISO C standard of 1999, a macro can be declared to accept a
  1279. variable number of arguments much as a function can. The syntax for
  1280. defining the macro is similar to that of a function. Here is an
  1281. example:
  1282. -<PRE>#define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
  1283. +<PRE>#define lprintf(format, ...) fprintf (log, format, __VA_ARGS__)
  1284. </PRE>
  1285. Here <CODE>...</CODE> is a <U>variable argument</U>. In the invocation of
  1286. such a macro, it represents the zero or more tokens until the closing
  1287. parenthesis that ends the invocation, including any commas. This set of
  1288. tokens replaces the identifier <CODE>__VA_ARGS__</CODE> in the macro body
  1289. -wherever it appears. See the CPP manual for more information.
  1290. +wherever it appears.
  1291. +For more information, see <A HREF="$$INFOLINK(cpp/SEC13)">Variadic Macros</A>.
  1292. <BR><BR>
  1293. GCC has long supported variadic macros, and used a different syntax that
  1294. allowed you to give a name to the variable arguments just like any other
  1295. argument. Here is an example:
  1296. -<PRE>#define debug(format, args...) fprintf (stderr, format, args)
  1297. +<PRE>#define lprintf(format, args...) fprintf (stderr, format, args)
  1298. </PRE>
  1299. This is in all ways equivalent to the ISO C example above, but arguably
  1300. more readable and descriptive.
  1301. @@ -29,7 +30,7 @@
  1302. entirely; but you are allowed to pass an empty argument. For example,
  1303. this invocation is invalid in ISO C, because there is no comma after
  1304. the string:
  1305. -<PRE>debug (&quot;A message&quot;)
  1306. +<PRE>lprintf (&quot;A message&quot;);
  1307. </PRE>
  1308. GNU CPP permits you to completely omit the variable arguments in this
  1309. way. In the above examples, the compiler would complain, though since
  1310. @@ -38,7 +39,7 @@
  1311. <BR><BR>
  1312. To help solve this problem, CPP behaves specially for variable arguments
  1313. used with the token paste operator, <CODE>##</CODE>. If instead you write
  1314. -<PRE>#define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
  1315. +<PRE>#define lprintf(format, ...) fprintf (log, format, ## __VA_ARGS__)
  1316. </PRE>
  1317. and if the variable arguments are omitted or empty, the <CODE>##</CODE>
  1318. operator causes the preprocessor to remove the comma before it. If you
  1319. diff -Nur gnuexts/SEC79.hss fix/gnuexts/SEC79.hss
  1320. --- gnuexts/SEC79.hss 2003-09-16 16:47:24.000000000 +0200
  1321. +++ fix/gnuexts/SEC79.hss 2003-09-16 22:56:08.000000000 +0200
  1322. @@ -1,12 +1,12 @@
  1323. [Main]
  1324. -Title=Arithmetic on @code{void}- and Function-Pointers
  1325. +Title=Arithmetic on void and Function Pointers
  1326. [Top]
  1327. In GNU C, addition and subtraction operations are supported on pointers to
  1328. -<CODE>void</CODE> and on pointers to functions. This is done by treating the
  1329. -size of a <CODE>void</CODE> or of a function as 1.
  1330. +<CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE> and on pointers to functions. This is done by treating the
  1331. +size of a <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE> or of a function as 1.
  1332. <BR><BR>
  1333. -A consequence of this is that <CODE>sizeof</CODE> is also allowed on <CODE>void</CODE>
  1334. +A consequence of this is that <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE> is also allowed on <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>
  1335. and on function types, and returns 1.
  1336. <BR><BR>
  1337. The option <B>'-Wpointer-arith'</B> requests a warning if these extensions
  1338. diff -Nur gnuexts/SEC80.hss fix/gnuexts/SEC80.hss
  1339. --- gnuexts/SEC80.hss 2003-09-16 16:47:24.000000000 +0200
  1340. +++ fix/gnuexts/SEC80.hss 2003-09-16 22:56:08.000000000 +0200
  1341. @@ -5,7 +5,7 @@
  1342. As in standard C++ and ISO C99, the elements of an aggregate initializer for an
  1343. automatic variable are not required to be constant expressions in GNU C.
  1344. Here is an example of an initializer with run-time varying elements:
  1345. -<PRE>foo (float f, float g)
  1346. +<PRE>void foo (float f, float g)
  1347. {
  1348. float beat_freqs[2] = { f-g, f+g };
  1349. /* ... */
  1350. diff -Nur gnuexts/SEC81.hss fix/gnuexts/SEC81.hss
  1351. --- gnuexts/SEC81.hss 2003-09-16 16:47:26.000000000 +0200
  1352. +++ fix/gnuexts/SEC81.hss 2003-09-16 22:56:08.000000000 +0200
  1353. @@ -1,5 +1,5 @@
  1354. [Main]
  1355. -Title=Compound Literals
  1356. +Title=Compound Literals (Cast Constructors)
  1357. [Top]
  1358. ISO C99 supports compound literals. A compound literal looks like
  1359. @@ -9,10 +9,10 @@
  1360. compound literals in C89 mode and in C++.
  1361. <BR><BR>
  1362. Usually, the specified type is a structure. Assume that
  1363. -<CODE>struct&nbsp;foo</CODE> and <CODE>structure</CODE> are declared as shown:
  1364. +<CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A>&nbsp;foo</CODE> and <I>structure</I> are declared as shown:
  1365. <PRE>struct foo {int a; char b[2];} structure;
  1366. </PRE>
  1367. -Here is an example of constructing a <CODE>struct&nbsp;foo</CODE> with a compound literal:
  1368. +Here is an example of constructing a <CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A>&nbsp;foo</CODE> with a compound literal:
  1369. <PRE>structure = ((struct foo) {x + y, 'a', 0});
  1370. </PRE>
  1371. This is equivalent to writing the following:
  1372. @@ -28,7 +28,7 @@
  1373. such an initializer, as shown here:
  1374. <PRE>char **foo = (char *[]) { &quot;x&quot;, &quot;y&quot;, &quot;z&quot; };
  1375. </PRE>
  1376. -Compound literals for scalar types and union types are is
  1377. +Compound literals for scalar types and union types are
  1378. also allowed, but then the compound literal is equivalent
  1379. to a cast.
  1380. <BR><BR>
  1381. diff -Nur gnuexts/SEC82.hss fix/gnuexts/SEC82.hss
  1382. --- gnuexts/SEC82.hss 2003-09-16 16:47:26.000000000 +0200
  1383. +++ fix/gnuexts/SEC82.hss 2003-09-16 22:56:08.000000000 +0200
  1384. @@ -8,8 +8,7 @@
  1385. <BR><BR>
  1386. In ISO C99 you can give the elements in any order, specifying the array
  1387. indices or structure field names they apply to, and GNU C allows this as
  1388. -an extension in C89 mode as well. This extension is not
  1389. -implemented in GNU C++.
  1390. +an extension in C89 mode as well.
  1391. <BR><BR>
  1392. To specify an array index, write
  1393. <CODE>[<I>index</I>]&nbsp;=</CODE> before the element value. For example,
  1394. @@ -59,10 +58,10 @@
  1395. union foo f = { .d = 4 };
  1396. </PRE>
  1397. -will convert 4 to a <CODE>double</CODE> to store it in the union using
  1398. -the second element. By contrast, casting 4 to type <CODE>union&nbsp;foo</CODE>
  1399. +will convert 4 to a <CODE><A HREF="$$INFOLINK(keywords/double)">double</A></CODE> to store it in the union using
  1400. +the second element. By contrast, casting 4 to type <CODE><A HREF="$$INFOLINK(keywords/union)">union</A>&nbsp;foo</CODE>
  1401. would store it into the union as the integer <CODE>i</CODE>, since it is
  1402. -an integer. (see <A HREF="$$LINK(SEC84)">Cast to Union</A>.)
  1403. +an integer (see <A HREF="$$LINK(SEC84)">Cast to Union</A>).
  1404. <BR><BR>
  1405. You can combine this technique of naming elements with ordinary C
  1406. initialization of successive elements. Each initializer element that
  1407. @@ -74,7 +73,7 @@
  1408. <PRE>int a[6] = { 0, v1, v2, 0, v4, 0 };
  1409. </PRE>
  1410. Labeling the elements of an array initializer is especially useful
  1411. -when the indices are characters or belong to an <CODE>enum</CODE> type.
  1412. +when the indices are characters or belong to an <CODE><A HREF="$$INFOLINK(keywords/enum)">enum</A></CODE> type.
  1413. For example:
  1414. <PRE>int whitespace[256]
  1415. = { [' '] = 1, ['\t'] = 1, ['\h'] = 1,
  1416. @@ -84,10 +83,10 @@
  1417. <CODE>[<I>index</I>]</CODE> designators before an <CODE>=</CODE> to specify a
  1418. nested subobject to initialize; the list is taken relative to the
  1419. subobject corresponding to the closest surrounding brace pair. For
  1420. -example, with the <CODE>struct&nbsp;point</CODE> declaration above:
  1421. +example, with the <CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A>&nbsp;point</CODE> declaration above:
  1422. <PRE>struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 };
  1423. </PRE>
  1424. If the same field is initialized multiple times, it will have value from
  1425. the last initialization. If any such overridden initialization has
  1426. side-effect, it is unspecified whether the side-effect happens or not.
  1427. -Currently, gcc will discard them and issue a warning.
  1428. +Currently, GCC will discard them and issue a warning.
  1429. diff -Nur gnuexts/SEC83.hss fix/gnuexts/SEC83.hss
  1430. --- gnuexts/SEC83.hss 2003-09-16 16:47:26.000000000 +0200
  1431. +++ fix/gnuexts/SEC83.hss 2003-09-16 22:56:08.000000000 +0200
  1432. @@ -12,7 +12,7 @@
  1433. This feature is especially useful for ranges of ASCII character codes:
  1434. <PRE>case 'A' ... 'Z':
  1435. </PRE>
  1436. -<B>Be careful:</B> Write spaces around the <CODE>...</CODE>, for otherwise
  1437. +<B>Note:</B> Always write spaces around the <CODE>...</CODE>, for otherwise
  1438. it may be parsed wrong when you use it with integer values. For example,
  1439. write this:
  1440. <PRE>case 1 ... 5:
  1441. diff -Nur gnuexts/SEC84.hss fix/gnuexts/SEC84.hss
  1442. --- gnuexts/SEC84.hss 2003-09-16 16:47:26.000000000 +0200
  1443. +++ fix/gnuexts/SEC84.hss 2003-09-16 22:56:08.000000000 +0200
  1444. @@ -4,9 +4,9 @@
  1445. [Top]
  1446. A cast to union type is similar to other casts, except that the type
  1447. specified is a union type. You can specify the type either with
  1448. -<CODE>union&nbsp;<I>tag</I></CODE> or with a typedef name. A cast to union is actually
  1449. +<CODE><A HREF="$$INFOLINK(keywords/union)">union</A>&nbsp;<I>tag</I></CODE> or with a typedef name. A cast to union is actually
  1450. a constructor though, not a cast, and hence does not yield an lvalue like
  1451. -normal casts. (see <A HREF="$$LINK(SEC81)">Compound Literals</A>.)
  1452. +normal casts (see <A HREF="$$LINK(SEC81)">Compound Literals</A>).
  1453. <BR><BR>
  1454. The types that may be cast to the union type are those of the members
  1455. of the union. Thus, given the following union and variables:
  1456. @@ -14,7 +14,7 @@
  1457. int x;
  1458. double y;
  1459. </PRE>
  1460. -both <CODE>x</CODE> and <CODE>y</CODE> can be cast to type <CODE>union&nbsp;foo</CODE>.
  1461. +both <I>x</I> and <I>y</I> can be cast to type <CODE><A HREF="$$INFOLINK(keywords/union)">union</A>&nbsp;foo</CODE>.
  1462. <BR><BR>
  1463. Using the cast as the right-hand side of an assignment to a variable of
  1464. union type is equivalent to storing in a member of the union:
  1465. diff -Nur gnuexts/SEC85.hss fix/gnuexts/SEC85.hss
  1466. --- gnuexts/SEC85.hss 2003-09-16 16:47:30.000000000 +0200
  1467. +++ fix/gnuexts/SEC85.hss 2003-09-17 01:30:18.000000000 +0200
  1468. @@ -1,5 +1,7 @@
  1469. [Main]
  1470. -Title=Declaring Attributes of Functions
  1471. +Title=Specifying Attributes of Functions
  1472. +Subsections=SEC85_noreturn, SEC85_pure, SEC85_const, SEC85_format, SEC85_format_arg, SEC85_no_instrument_function, SEC85_section, SEC85_constructor, SEC85_unused, SEC85_used, SEC85_malloc, SEC85_alias, SEC85_always_inline, SEC85_noinline, SEC85_deprecated, SEC85_regparm, SEC85_nonnull, SEC85_nothrow
  1473. +Index=__attribute__, CALLBACK, __ATTR_TIOS__, __ATTR_TIOS_NORETURN__, __ATTR_TIOS_CALLBACK__, __ATTR_GCC__, __ATTR_LIB_C__, __ATTR_LIB_ASM__, __ATTR_LIB_ASM_NORETURN__, __ATTR_LIB_CALLBACK_C__, __ATTR_LIB_CALLBACK_ASM__
  1474. [Top]
  1475. In GNU C, you declare certain things about functions called in your program
  1476. @@ -8,22 +10,29 @@
  1477. <BR><BR>
  1478. The keyword <CODE>__attribute__</CODE> allows you to specify special
  1479. attributes when making a declaration. This keyword is followed by an
  1480. -attribute specification inside double parentheses. The following
  1481. -attributes are currently defined for functions on all targets:
  1482. -<CODE>noreturn</CODE>, <CODE>noinline</CODE>, <CODE>always_inline</CODE>,
  1483. -<CODE>pure</CODE>, <CODE>const</CODE>, <CODE>nothrow</CODE>,
  1484. -<CODE>format</CODE>, <CODE>format_arg</CODE>, <CODE>no_instrument_function</CODE>,
  1485. -<CODE>section</CODE>, <CODE>constructor</CODE>, <CODE>destructor</CODE>, <CODE>used</CODE>,
  1486. -<CODE>unused</CODE>, <CODE>deprecated</CODE>, <CODE>weak</CODE>, <CODE>malloc</CODE>,
  1487. -<CODE>alias</CODE>, and <CODE>nonnull</CODE>. Several other attributes are defined
  1488. -for functions on particular target systems. Other attributes, including
  1489. -<CODE>section</CODE> are supported for variables declarations
  1490. -(see <A HREF="$$LINK(SEC91)">Variable Attributes</A>) and for types (see <A HREF="$$LINK(SEC92)">Type Attributes</A>).
  1491. +attribute specification inside double parentheses.
  1492. +The following attributes are currently defined for functions:
  1493. +
  1494. +[Bottom]
  1495. +Other attributes are supported for variable declarations (see <A HREF="$$LINK(SEC91)">Variable Attributes</A>)
  1496. +and for types (see <A HREF="$$LINK(SEC92)">Type Attributes</A>).
  1497. +<BR><BR>
  1498. +TIGCC also defines the macros <CODE>CALLBACK, __ATTR_TIOS__, __ATTR_TIOS_NORETURN__, __ATTR_TIOS_CALLBACK__, __ATTR_GCC__, __ATTR_LIB_C__, __ATTR_LIB_ASM__, __ATTR_LIB_ASM_NORETURN__, __ATTR_LIB_CALLBACK_C__,</CODE> and <CODE>__ATTR_LIB_CALLBACK_ASM__</CODE>.
  1499. +They are useful for specifying default attributes for a specific class of functions.
  1500. +You only need to use them when you define a callback function.
  1501. +For example, the callback function type <A HREF="$$LINK(stdlib.h/compare_t)">compare_t</A>
  1502. +needs the attributes specified by <CODE>__ATTR_LIB_CALLBACK_C__</CODE>,
  1503. +i.e. the attributes required by a callback function for a library function
  1504. +written in C. Since this is too inconvenient for the user, all three callback
  1505. +attributes have been made equal, and we have defined a single <CODE>CALLBACK</CODE>
  1506. +macro.
  1507. <BR><BR>
  1508. You may also specify attributes with <CODE>__</CODE> preceding and following
  1509. each keyword. This allows you to use them in header files without
  1510. being concerned about a possible macro of the same name. For example,
  1511. you may use <CODE>__noreturn__</CODE> instead of <CODE>noreturn</CODE>.
  1512. +For example, as <A HREF="$$LINK(alloc.h/malloc)">malloc</A> is defined as a macro in the TIGCC Library,
  1513. +always use <CODE>__malloc__</CODE> instead of <CODE>malloc</CODE>.
  1514. <BR><BR>
  1515. See <A HREF="$$LINK(SEC85a)">Attribute Syntax</A> for details of the exact syntax for using
  1516. attributes.
  1517. @@ -33,7 +42,7 @@
  1518. attribute declaration with another attribute declaration.
  1519. <BR><BR>
  1520. Some people object to the <CODE>__attribute__</CODE> feature, suggesting that
  1521. -ISO C's <CODE>#pragma</CODE> should be used instead. At the time
  1522. +ISO C's <CODE><A HREF="$$INFOLINK(cpp/SEC46)">#pragma</A></CODE> should be used instead. At the time
  1523. <CODE>__attribute__</CODE> was designed, there were two reasons for not doing
  1524. this.
  1525. <OL>
  1526. @@ -56,5 +65,4 @@
  1527. found convenient to use <CODE>__attribute__</CODE> to achieve a natural
  1528. attachment of attributes to their corresponding declarations, whereas
  1529. <CODE>#pragma&nbsp;GCC</CODE> is of use for constructs that do not naturally form
  1530. -part of the grammar. See <A HREF="$$INFOLINK(Other Directives,,Miscellaneous Preprocessing Directives, cpp, The C Preprocessor)">Miscellaneous
  1531. -Preprocessing Directives, cpp, The C Preprocessor</A>.
  1532. +part of the grammar.
  1533. diff -Nur gnuexts/SEC85_alias.hss fix/gnuexts/SEC85_alias.hss
  1534. --- gnuexts/SEC85_alias.hss 2003-09-16 16:47:28.000000000 +0200
  1535. +++ fix/gnuexts/SEC85_alias.hss 2003-09-17 00:55:38.000000000 +0200
  1536. @@ -2,12 +2,14 @@
  1537. Title=alias
  1538. [Top]
  1539. +Syntax: <B>alias (&quot;<I>target</I>&quot;)</B>
  1540. +<BR><BR>
  1541. The <CODE>alias</CODE> attribute causes the declaration to be emitted as an
  1542. alias for another symbol, which must be specified. For instance,
  1543. <PRE>void __f () { /* Do something. */; }
  1544. void f () __attribute__ ((weak, alias (&quot;__f&quot;)));
  1545. </PRE>
  1546. -declares <CODE>f</CODE> to be a weak alias for <CODE>__f</CODE>. In C++, the
  1547. -mangled name for the target must be used.
  1548. +declares <I>f</I> to be a weak alias for <I>__f</I>.
  1549. <BR><BR>
  1550. Not all target machines support this attribute.
  1551. +We haven't tested yet whether it is supported for the Motorola 68000.
  1552. diff -Nur gnuexts/SEC85_cdecl.hss fix/gnuexts/SEC85_cdecl.hss
  1553. --- gnuexts/SEC85_cdecl.hss 2003-09-16 16:47:28.000000000 +0200
  1554. +++ fix/gnuexts/SEC85_cdecl.hss 1970-01-01 01:00:00.000000000 +0100
  1555. @@ -1,11 +0,0 @@
  1556. -[Main]
  1557. -Title=cdecl
  1558. -
  1559. -[Top]
  1560. -On the Intel 386, the <CODE>cdecl</CODE> attribute causes the compiler to
  1561. -assume that the calling function will pop off the stack space used to
  1562. -pass arguments. This is
  1563. -useful to override the effects of the <B>'-mrtd'</B> switch.
  1564. -<BR><BR>
  1565. -The PowerPC compiler for Windows NT currently ignores the <CODE>cdecl</CODE>
  1566. -attribute.
  1567. diff -Nur gnuexts/SEC85_const.hss fix/gnuexts/SEC85_const.hss
  1568. --- gnuexts/SEC85_const.hss 2003-09-16 16:47:26.000000000 +0200
  1569. +++ fix/gnuexts/SEC85_const.hss 2003-09-16 22:56:08.000000000 +0200
  1570. @@ -1,25 +1,15 @@
  1571. [Main]
  1572. Title=const
  1573. +See Also=SEC85_pure: pure
  1574. [Top]
  1575. Many functions do not examine any values except their arguments, and
  1576. have no effects except the return value. Basically this is just slightly
  1577. -more strict class than the <CODE>pure</CODE> attribute above, since function is not
  1578. +more strict class than the <CODE><A HREF="$$LINK(SEC85_pure)">pure</A></CODE> attribute, since the function is not
  1579. allowed to read global memory.
  1580. <BR><BR>
  1581. Note that a function that has pointer arguments and examines the data
  1582. pointed to must <I>not</I> be declared <CODE>const</CODE>. Likewise, a
  1583. function that calls a non-<CODE>const</CODE> function usually must not be
  1584. <CODE>const</CODE>. It does not make sense for a <CODE>const</CODE> function to
  1585. -return <CODE>void</CODE>.
  1586. -<BR><BR>
  1587. -The attribute <CODE>const</CODE> is not implemented in GCC versions earlier
  1588. -than 2.5. An alternative way to declare that a function has no side
  1589. -effects, which works in the current version and in some older versions,
  1590. -is as follows:
  1591. -<PRE>typedef int intfn ();
  1592. -
  1593. -extern const intfn square;
  1594. -</PRE>
  1595. -This approach does not work in GNU C++ from 2.6.0 on, since the language
  1596. -specifies that the <CODE>const</CODE> must be attached to the return value.
  1597. +return <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>.
  1598. diff -Nur gnuexts/SEC85_constructor.hss fix/gnuexts/SEC85_constructor.hss
  1599. --- gnuexts/SEC85_constructor.hss 1970-01-01 01:00:00.000000000 +0100
  1600. +++ fix/gnuexts/SEC85_constructor.hss 2003-09-16 23:37:02.000000000 +0200
  1601. @@ -0,0 +1,11 @@
  1602. +[Main]
  1603. +Title=constructor, destructor
  1604. +
  1605. +[Top]
  1606. +The <CODE>constructor</CODE> attribute causes the function to be called
  1607. +automatically before execution enters _main. Similarly, the
  1608. +<CODE>destructor</CODE> attribute causes the function to be called
  1609. +automatically after _main has completed or <A HREF="$$LINK(stdlib.h/exit)">exit</A> has
  1610. +been called. Functions with these attributes are useful for
  1611. +initializing data that will be used implicitly during the execution of
  1612. +the program.
  1613. diff -Nur gnuexts/SEC85_default.hss fix/gnuexts/SEC85_default.hss
  1614. --- gnuexts/SEC85_default.hss 2003-09-16 16:47:28.000000000 +0200
  1615. +++ fix/gnuexts/SEC85_default.hss 1970-01-01 01:00:00.000000000 +0100
  1616. @@ -1,7 +0,0 @@
  1617. -[Main]
  1618. -Title=default
  1619. -
  1620. -[Top]
  1621. -Default visibility is the normal case for ELF. This value is
  1622. -available for the visibility attribute to override other options
  1623. -that may change the assumed visibility of symbols.
  1624. diff -Nur gnuexts/SEC85_deprecated.hss fix/gnuexts/SEC85_deprecated.hss
  1625. --- gnuexts/SEC85_deprecated.hss 2003-09-16 16:47:28.000000000 +0200
  1626. +++ fix/gnuexts/SEC85_deprecated.hss 2003-09-16 22:56:08.000000000 +0200
  1627. @@ -15,5 +15,5 @@
  1628. </PRE>
  1629. results in a warning on line 3 but not line 2.
  1630. <BR><BR>
  1631. -The <CODE>deprecated</CODE> attribute can also be used for variables and
  1632. -types (see <A HREF="$$LINK(SEC91)">Variable Attributes</A> See <A HREF="$$LINK(SEC92)">Type Attributes</A>.)
  1633. +The <CODE>deprecated</CODE> attribute can also be used for <A HREF="$$LINK(SEC91_deprecated)">variables</A> and
  1634. +<A HREF="$$LINK(SEC92_deprecated)">types</A>.
  1635. diff -Nur gnuexts/SEC85_destructor.hss fix/gnuexts/SEC85_destructor.hss
  1636. --- gnuexts/SEC85_destructor.hss 2003-09-16 16:47:28.000000000 +0200
  1637. +++ fix/gnuexts/SEC85_destructor.hss 1970-01-01 01:00:00.000000000 +0100
  1638. @@ -1,13 +0,0 @@
  1639. -[Main]
  1640. -Title=destructor
  1641. -
  1642. -[Top]
  1643. -The <CODE>constructor</CODE> attribute causes the function to be called
  1644. -automatically before execution enters <CODE>main&nbsp;()</CODE>. Similarly, the
  1645. -<CODE>destructor</CODE> attribute causes the function to be called
  1646. -automatically after <CODE>main&nbsp;()</CODE> has completed or <CODE>exit&nbsp;()</CODE> has
  1647. -been called. Functions with these attributes are useful for
  1648. -initializing data that will be used implicitly during the execution of
  1649. -the program.
  1650. -<BR><BR>
  1651. -These attributes are not currently implemented for Objective-C.
  1652. diff -Nur gnuexts/SEC85_dllexport.hss fix/gnuexts/SEC85_dllexport.hss
  1653. --- gnuexts/SEC85_dllexport.hss 2003-09-16 16:47:30.000000000 +0200
  1654. +++ fix/gnuexts/SEC85_dllexport.hss 1970-01-01 01:00:00.000000000 +0100
  1655. @@ -1,8 +0,0 @@
  1656. -[Main]
  1657. -Title=dllexport
  1658. -
  1659. -[Top]
  1660. -On the PowerPC running Windows NT, the <CODE>dllexport</CODE> attribute causes
  1661. -the compiler to provide a global pointer to the function pointer, so
  1662. -that it can be called with the <CODE>dllimport</CODE> attribute. The pointer
  1663. -name is formed by combining <CODE>__imp_</CODE> and the function name.
  1664. diff -Nur gnuexts/SEC85_dllimport.hss fix/gnuexts/SEC85_dllimport.hss
  1665. --- gnuexts/SEC85_dllimport.hss 2003-09-16 16:47:28.000000000 +0200
  1666. +++ fix/gnuexts/SEC85_dllimport.hss 1970-01-01 01:00:00.000000000 +0100
  1667. @@ -1,8 +0,0 @@
  1668. -[Main]
  1669. -Title=dllimport
  1670. -
  1671. -[Top]
  1672. -On the PowerPC running Windows NT, the <CODE>dllimport</CODE> attribute causes
  1673. -the compiler to call the function via a global pointer to the function
  1674. -pointer that is set up by the Windows NT dll library. The pointer name
  1675. -is formed by combining <CODE>__imp_</CODE> and the function name.
  1676. diff -Nur gnuexts/SEC85_eightbit_data.hss fix/gnuexts/SEC85_eightbit_data.hss
  1677. --- gnuexts/SEC85_eightbit_data.hss 2003-09-16 16:47:30.000000000 +0200
  1678. +++ fix/gnuexts/SEC85_eightbit_data.hss 1970-01-01 01:00:00.000000000 +0100
  1679. @@ -1,12 +0,0 @@
  1680. -[Main]
  1681. -Title=eightbit_data
  1682. -
  1683. -[Top]
  1684. -Use this attribute on the H8/300 and H8/300H to indicate that the specified
  1685. -variable should be placed into the eight bit data section.
  1686. -The compiler will generate more efficient code for certain operations
  1687. -on data in the eight bit data area. Note the eight bit data area is limited to
  1688. -256 bytes of data.
  1689. -<BR><BR>
  1690. -You must use GAS and GLD from GNU binutils version 2.7 or later for
  1691. -this attribute to work correctly.
  1692. diff -Nur gnuexts/SEC85_exception.hss fix/gnuexts/SEC85_exception.hss
  1693. --- gnuexts/SEC85_exception.hss 2003-09-16 16:47:30.000000000 +0200
  1694. +++ fix/gnuexts/SEC85_exception.hss 1970-01-01 01:00:00.000000000 +0100
  1695. @@ -1,12 +0,0 @@
  1696. -[Main]
  1697. -Title=exception
  1698. -
  1699. -[Top]
  1700. -On the PowerPC running Windows NT, the <CODE>exception</CODE> attribute causes
  1701. -the compiler to modify the structured exception table entry it emits for
  1702. -the declared function. The string or identifier <I>except-func</I> is
  1703. -placed in the third entry of the structured exception table. It
  1704. -represents a function, which is called by the exception handling
  1705. -mechanism if an exception occurs. If it was specified, the string or
  1706. -identifier <I>except-arg</I> is placed in the fourth entry of the
  1707. -structured exception table.
  1708. diff -Nur gnuexts/SEC85_far.hss fix/gnuexts/SEC85_far.hss
  1709. --- gnuexts/SEC85_far.hss 2003-09-16 16:47:30.000000000 +0200
  1710. +++ fix/gnuexts/SEC85_far.hss 1970-01-01 01:00:00.000000000 +0100
  1711. @@ -1,18 +0,0 @@
  1712. -[Main]
  1713. -Title=far
  1714. -
  1715. -[Top]
  1716. -On 68HC11 and 68HC12 the <CODE>far</CODE> attribute causes the compiler to
  1717. -use a calling convention that takes care of switching memory banks when
  1718. -entering and leaving a function. This calling convention is also the
  1719. -default when using the <B>'-mlong-calls'</B> option.
  1720. -<BR><BR>
  1721. -On 68HC12 the compiler will use the <CODE>call</CODE> and <CODE>rtc</CODE> instructions
  1722. -to call and return from a function.
  1723. -<BR><BR>
  1724. -On 68HC11 the compiler will generate a sequence of instructions
  1725. -to invoke a board-specific routine to switch the memory bank and call the
  1726. -real function. The board-specific routine simulates a <CODE>call</CODE>.
  1727. -At the end of a function, it will jump to a board-specific routine
  1728. -instead of using <CODE>rts</CODE>. The board-specific return routine simulates
  1729. -the <CODE>rtc</CODE>.
  1730. diff -Nur gnuexts/SEC85_format.hss fix/gnuexts/SEC85_format.hss
  1731. --- gnuexts/SEC85_format.hss 2003-09-16 16:47:28.000000000 +0200
  1732. +++ fix/gnuexts/SEC85_format.hss 2003-09-16 22:56:08.000000000 +0200
  1733. @@ -2,32 +2,35 @@
  1734. Title=format
  1735. [Top]
  1736. -The <CODE>format</CODE> attribute specifies that a function takes <CODE>printf</CODE>,
  1737. -<CODE>scanf</CODE>, <CODE>strftime</CODE> or <CODE>strfmon</CODE> style arguments which
  1738. +Syntax: <B>format (<I>archetype</I>, <I>string-index</I>, <I>first-to-check</I>)</B>
  1739. +<BR><BR>
  1740. +The <CODE>format</CODE> attribute specifies that a function takes <A HREF="$$LINK(stdio.h/printf)">printf</A>
  1741. +style arguments which
  1742. should be type-checked against a format string. For example, the
  1743. declaration:
  1744. <PRE>extern int
  1745. my_printf (void *my_object, const char *my_format, ...)
  1746. __attribute__ ((format (printf, 2, 3)));
  1747. </PRE>
  1748. -causes the compiler to check the arguments in calls to <CODE>my_printf</CODE>
  1749. -for consistency with the <CODE>printf</CODE> style format string argument
  1750. -<CODE>my_format</CODE>.
  1751. +causes the compiler to check the arguments in calls to <I>my_printf</I>
  1752. +for consistency with the <A HREF="$$LINK(stdio.h/printf)">printf</A> style format string argument
  1753. +<I>my_format</I>.
  1754. <BR><BR>
  1755. The parameter <I>archetype</I> determines how the format string is
  1756. interpreted, and should be <CODE>printf</CODE>, <CODE>scanf</CODE>, <CODE>strftime</CODE>
  1757. -or <CODE>strfmon</CODE>. (You can also use <CODE>__printf__</CODE>,
  1758. +or <CODE>strfmon</CODE> (note that only the function <A HREF="$$LINK(stdio.h/printf)">printf</A> is implemented in the TIGCC Library).
  1759. +(You can also use <CODE>__printf__</CODE>,
  1760. <CODE>__scanf__</CODE>, <CODE>__strftime__</CODE> or <CODE>__strfmon__</CODE>.) The
  1761. parameter <I>string-index</I> specifies which argument is the format
  1762. string argument (starting from 1), while <I>first-to-check</I> is the
  1763. number of the first argument to check against the format string. For
  1764. functions where the arguments are not available to be checked (such as
  1765. -<CODE>vprintf</CODE>), specify the third parameter as zero. In this case the
  1766. +<A HREF="$$LINK(stdio.h/vprintf)">vprintf</A>), specify the third parameter as zero. In this case the
  1767. compiler only checks the format string for consistency. For
  1768. <CODE>strftime</CODE> formats, the third parameter is required to be zero.
  1769. <BR><BR>
  1770. -In the example above, the format string (<CODE>my_format</CODE>) is the second
  1771. -argument of the function <CODE>my_print</CODE>, and the arguments to check
  1772. +In the example above, the format string (<I>my_format</I>) is the second
  1773. +argument of the function <I>my_print</I>, and the arguments to check
  1774. start with the third argument, so the correct parameters for the format
  1775. attribute are 2 and 3.
  1776. <BR><BR>
  1777. @@ -35,13 +38,5 @@
  1778. which take format strings as arguments, so that GCC can check the
  1779. calls to these functions for errors. The compiler always (unless
  1780. <B>'-ffreestanding'</B> is used) checks formats
  1781. -for the standard library functions <CODE>printf</CODE>, <CODE>fprintf</CODE>,
  1782. -<CODE>sprintf</CODE>, <CODE>scanf</CODE>, <CODE>fscanf</CODE>, <CODE>sscanf</CODE>, <CODE>strftime</CODE>,
  1783. -<CODE>vprintf</CODE>, <CODE>vfprintf</CODE> and <CODE>vsprintf</CODE> whenever such
  1784. -warnings are requested (using <B>'-Wformat'</B>), so there is no need to
  1785. -modify the header file <CODE>stdio.h</CODE>. In C99 mode, the functions
  1786. -<CODE>snprintf</CODE>, <CODE>vsnprintf</CODE>, <CODE>vscanf</CODE>, <CODE>vfscanf</CODE> and
  1787. -<CODE>vsscanf</CODE> are also checked. Except in strictly conforming C
  1788. -standard modes, the X/Open function <CODE>strfmon</CODE> is also checked as
  1789. -are <CODE>printf_unlocked</CODE> and <CODE>fprintf_unlocked</CODE>.
  1790. +for the standard library functions.
  1791. See <A HREF="$$INFOLINK(comopts/SEC6)">Options Controlling C Dialect</A>.
  1792. diff -Nur gnuexts/SEC85_format_arg.hss fix/gnuexts/SEC85_format_arg.hss
  1793. --- gnuexts/SEC85_format_arg.hss 2003-09-16 16:47:28.000000000 +0200
  1794. +++ fix/gnuexts/SEC85_format_arg.hss 2003-09-16 22:56:08.000000000 +0200
  1795. @@ -2,22 +2,22 @@
  1796. Title=format_arg
  1797. [Top]
  1798. +Syntax: <B>format_arg (<I>string-index</I>)</B>
  1799. +<BR><BR>
  1800. The <CODE>format_arg</CODE> attribute specifies that a function takes a format
  1801. -string for a <CODE>printf</CODE>, <CODE>scanf</CODE>, <CODE>strftime</CODE> or
  1802. -<CODE>strfmon</CODE> style function and modifies it (for example, to translate
  1803. +string for a <A HREF="$$LINK(stdio.h/printf)">printf</A> style function and modifies it (for example, to translate
  1804. it into another language), so the result can be passed to a
  1805. -<CODE>printf</CODE>, <CODE>scanf</CODE>, <CODE>strftime</CODE> or <CODE>strfmon</CODE> style
  1806. +<A HREF="$$LINK(stdio.h/printf)">printf</A> style
  1807. function (with the remaining arguments to the format function the same
  1808. as they would have been for the unmodified string). For example, the
  1809. -declaration:
  1810. +declaration
  1811. <PRE>extern char *
  1812. my_dgettext (char *my_domain, const char *my_format)
  1813. __attribute__ ((format_arg (2)));
  1814. </PRE>
  1815. -causes the compiler to check the arguments in calls to a <CODE>printf</CODE>,
  1816. -<CODE>scanf</CODE>, <CODE>strftime</CODE> or <CODE>strfmon</CODE> type function, whose
  1817. -format string argument is a call to the <CODE>my_dgettext</CODE> function, for
  1818. -consistency with the format string argument <CODE>my_format</CODE>. If the
  1819. +causes the compiler to check the arguments in calls to a <A HREF="$$LINK(stdio.h/printf)">printf</A> type function, whose
  1820. +format string argument is the result of a call to the <I>my_dgettext</I> function, for
  1821. +consistency with the format string argument <I>my_format</I>. If the
  1822. <CODE>format_arg</CODE> attribute had not been specified, all the compiler
  1823. could tell in such calls to format functions would be that the format
  1824. string argument is not constant; this would generate a warning when
  1825. @@ -29,10 +29,10 @@
  1826. <BR><BR>
  1827. The <CODE>format-arg</CODE> attribute allows you to identify your own
  1828. functions which modify format strings, so that GCC can check the
  1829. -calls to <CODE>printf</CODE>, <CODE>scanf</CODE>, <CODE>strftime</CODE> or <CODE>strfmon</CODE>
  1830. -type function whose operands are a call to one of your own function.
  1831. -The compiler always treats <CODE>gettext</CODE>, <CODE>dgettext</CODE>, and
  1832. +calls to <A HREF="$$LINK(stdio.h/printf)">printf</A>
  1833. +type functions whose operands are calls to one of your own functions.
  1834. +(The compiler always treats <CODE>gettext</CODE>, <CODE>dgettext</CODE>, and
  1835. <CODE>dcgettext</CODE> in this manner except when strict ISO C support is
  1836. requested by <B>'-ansi'</B> or an appropriate <B>'-std'</B> option, or
  1837. <B>'-ffreestanding'</B> is used. See <A HREF="$$INFOLINK(comopts/SEC6)">Options
  1838. -Controlling C Dialect</A>.
  1839. +Controlling C Dialect</A>.)
  1840. diff -Nur gnuexts/SEC85_function_vector.hss fix/gnuexts/SEC85_function_vector.hss
  1841. --- gnuexts/SEC85_function_vector.hss 2003-09-16 16:47:30.000000000 +0200
  1842. +++ fix/gnuexts/SEC85_function_vector.hss 1970-01-01 01:00:00.000000000 +0100
  1843. @@ -1,12 +0,0 @@
  1844. -[Main]
  1845. -Title=function_vector
  1846. -
  1847. -[Top]
  1848. -Use this attribute on the H8/300 and H8/300H to indicate that the specified
  1849. -function should be called through the function vector. Calling a
  1850. -function through the function vector will reduce code size, however;
  1851. -the function vector has a limited size (maximum 128 entries on the H8/300
  1852. -and 64 entries on the H8/300H) and shares space with the interrupt vector.
  1853. -<BR><BR>
  1854. -You must use GAS and GLD from GNU binutils version 2.7 or later for
  1855. -this attribute to work correctly.
  1856. diff -Nur gnuexts/SEC85_hidden.hss fix/gnuexts/SEC85_hidden.hss
  1857. --- gnuexts/SEC85_hidden.hss 2003-09-16 16:47:28.000000000 +0200
  1858. +++ fix/gnuexts/SEC85_hidden.hss 1970-01-01 01:00:00.000000000 +0100
  1859. @@ -1,7 +0,0 @@
  1860. -[Main]
  1861. -Title=hidden
  1862. -
  1863. -[Top]
  1864. -Hidden visibility indicates that the symbol will not be placed into
  1865. -the dynamic symbol table, so no other <U>module</U> (executable or
  1866. -shared library) can reference it directly.
  1867. diff -Nur gnuexts/SEC85_internal.hss fix/gnuexts/SEC85_internal.hss
  1868. --- gnuexts/SEC85_internal.hss 2003-09-16 16:47:28.000000000 +0200
  1869. +++ fix/gnuexts/SEC85_internal.hss 1970-01-01 01:00:00.000000000 +0100
  1870. @@ -1,12 +0,0 @@
  1871. -[Main]
  1872. -Title=internal
  1873. -
  1874. -[Top]
  1875. -Internal visibility is like hidden visibility, but with additional
  1876. -processor specific semantics. Unless otherwise specified by the psABI,
  1877. -gcc defines internal visibility to mean that the function is <I>never</I>
  1878. -called from another module. Note that hidden symbols, while then cannot
  1879. -be referenced directly by other modules, can be referenced indirectly via
  1880. -function pointers. By indicating that a symbol cannot be called from
  1881. -outside the module, gcc may for instance omit the load of a PIC register
  1882. -since it is known that the calling function loaded the correct value.
  1883. diff -Nur gnuexts/SEC85_interrupt.hss fix/gnuexts/SEC85_interrupt.hss
  1884. --- gnuexts/SEC85_interrupt.hss 2003-09-16 16:47:30.000000000 +0200
  1885. +++ fix/gnuexts/SEC85_interrupt.hss 1970-01-01 01:00:00.000000000 +0100
  1886. @@ -1,19 +0,0 @@
  1887. -[Main]
  1888. -Title=interrupt
  1889. -
  1890. -[Top]
  1891. -Use this attribute on the ARM, AVR, M32R/D and Xstormy16 ports to indicate
  1892. -that the specified function is an interrupt handler. The compiler will
  1893. -generate function entry and exit sequences suitable for use in an
  1894. -interrupt handler when this attribute is present.
  1895. -<BR><BR>
  1896. -Note, interrupt handlers for the H8/300, H8/300H and SH processors can
  1897. -be specified via the <CODE>interrupt_handler</CODE> attribute.
  1898. -<BR><BR>
  1899. -Note, on the AVR interrupts will be enabled inside the function.
  1900. -<BR><BR>
  1901. -Note, for the ARM you can specify the kind of interrupt to be handled by
  1902. -adding an optional parameter to the interrupt attribute like this:
  1903. -<PRE>void f () __attribute__ ((interrupt (&quot;IRQ&quot;)));
  1904. -</PRE>
  1905. -Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF.
  1906. diff -Nur gnuexts/SEC85_interrupt_handler.hss fix/gnuexts/SEC85_interrupt_handler.hss
  1907. --- gnuexts/SEC85_interrupt_handler.hss 2003-09-16 16:47:30.000000000 +0200
  1908. +++ fix/gnuexts/SEC85_interrupt_handler.hss 1970-01-01 01:00:00.000000000 +0100
  1909. @@ -1,8 +0,0 @@
  1910. -[Main]
  1911. -Title=interrupt_handler
  1912. -
  1913. -[Top]
  1914. -Use this attribute on the H8/300, H8/300H and SH to indicate that the
  1915. -specified function is an interrupt handler. The compiler will generate
  1916. -function entry and exit sequences suitable for use in an interrupt
  1917. -handler when this attribute is present.
  1918. diff -Nur gnuexts/SEC85_long_call and short_call.hss fix/gnuexts/SEC85_long_call and short_call.hss
  1919. --- gnuexts/SEC85_long_call and short_call.hss 2003-09-16 16:47:28.000000000 +0200
  1920. +++ fix/gnuexts/SEC85_long_call and short_call.hss 1970-01-01 01:00:00.000000000 +0100
  1921. @@ -1,12 +0,0 @@
  1922. -[Main]
  1923. -Title=long_call/short_call
  1924. -
  1925. -[Top]
  1926. -This attribute allows to specify how to call a particular function on
  1927. -ARM. Both attributes override the <B>'-mlong-calls'</B> (see <A HREF="$$INFOLINK(ARM Options)">ARM Options</A>)
  1928. -command line switch and <CODE>#pragma&nbsp;long_calls</CODE> settings. The
  1929. -<CODE>long_call</CODE> attribute causes the compiler to always call the
  1930. -function by first loading its address into a register and then using the
  1931. -contents of that register. The <CODE>short_call</CODE> attribute always places
  1932. -the offset to the function from the call site into the <CODE>BL</CODE>
  1933. -instruction directly.
  1934. diff -Nur gnuexts/SEC85_longcall and shortcall.hss fix/gnuexts/SEC85_longcall and shortcall.hss
  1935. --- gnuexts/SEC85_longcall and shortcall.hss 2003-09-16 16:47:28.000000000 +0200
  1936. +++ fix/gnuexts/SEC85_longcall and shortcall.hss 1970-01-01 01:00:00.000000000 +0100
  1937. @@ -1,13 +0,0 @@
  1938. -[Main]
  1939. -Title=longcall/shortcall
  1940. -
  1941. -[Top]
  1942. -On the RS/6000 and PowerPC, the <CODE>longcall</CODE> attribute causes the
  1943. -compiler to always call this function via a pointer, just as it would if
  1944. -the <B>'-mlongcall'</B> option had been specified. The <CODE>shortcall</CODE>
  1945. -attribute causes the compiler not to do this. These attributes override
  1946. -both the <B>'-mlongcall'</B> switch and the <CODE>#pragma&nbsp;longcall</CODE>
  1947. -setting.
  1948. -<BR><BR>
  1949. -See <A HREF="$$INFOLINK(RS_6000 and PowerPC Options)">RS/6000 and PowerPC Options</A> for more information on when long
  1950. -calls are and are not necessary.
  1951. diff -Nur gnuexts/SEC85_malloc.hss fix/gnuexts/SEC85_malloc.hss
  1952. --- gnuexts/SEC85_malloc.hss 2003-09-16 16:47:28.000000000 +0200
  1953. +++ fix/gnuexts/SEC85_malloc.hss 2003-09-16 22:56:08.000000000 +0200
  1954. @@ -3,6 +3,6 @@
  1955. [Top]
  1956. The <CODE>malloc</CODE> attribute is used to tell the compiler that a function
  1957. -may be treated as if it were the malloc function. The compiler assumes
  1958. -that calls to malloc result in a pointers that cannot alias anything.
  1959. +may be treated as if it were the <A HREF="$$LINK(alloc.h/malloc)">malloc</A> function. The compiler assumes
  1960. +that calls to <A HREF="$$LINK(alloc.h/malloc)">malloc</A> result in a pointers that cannot alias anything.
  1961. This will often improve optimization.
  1962. diff -Nur gnuexts/SEC85_model.hss fix/gnuexts/SEC85_model.hss
  1963. --- gnuexts/SEC85_model.hss 2003-09-16 16:47:30.000000000 +0200
  1964. +++ fix/gnuexts/SEC85_model.hss 1970-01-01 01:00:00.000000000 +0100
  1965. @@ -1,21 +0,0 @@
  1966. -[Main]
  1967. -Title=model
  1968. -
  1969. -[Top]
  1970. -Use this attribute on the M32R/D to set the addressability of an object,
  1971. -and the code generated for a function.
  1972. -The identifier <I>model-name</I> is one of <CODE>small</CODE>, <CODE>medium</CODE>,
  1973. -or <CODE>large</CODE>, representing each of the code models.
  1974. -<BR><BR>
  1975. -Small model objects live in the lower 16MB of memory (so that their
  1976. -addresses can be loaded with the <CODE>ld24</CODE> instruction), and are
  1977. -callable with the <CODE>bl</CODE> instruction.
  1978. -<BR><BR>
  1979. -Medium model objects may live anywhere in the 32-bit address space (the
  1980. -compiler will generate <CODE>seth/add3</CODE> instructions to load their addresses),
  1981. -and are callable with the <CODE>bl</CODE> instruction.
  1982. -<BR><BR>
  1983. -Large model objects may live anywhere in the 32-bit address space (the
  1984. -compiler will generate <CODE>seth/add3</CODE> instructions to load their addresses),
  1985. -and may not be reachable with the <CODE>bl</CODE> instruction (the compiler will
  1986. -generate the much slower <CODE>seth/add3/jl</CODE> instruction sequence).
  1987. diff -Nur gnuexts/SEC85_naked.hss fix/gnuexts/SEC85_naked.hss
  1988. --- gnuexts/SEC85_naked.hss 2003-09-16 16:47:30.000000000 +0200
  1989. +++ fix/gnuexts/SEC85_naked.hss 1970-01-01 01:00:00.000000000 +0100
  1990. @@ -1,7 +0,0 @@
  1991. -[Main]
  1992. -Title=naked
  1993. -
  1994. -[Top]
  1995. -Use this attribute on the ARM, AVR and IP2K ports to indicate that the
  1996. -specified function do not need prologue/epilogue sequences generated by
  1997. -the compiler. It is up to the programmer to provide these sequences.
  1998. diff -Nur gnuexts/SEC85_near.hss fix/gnuexts/SEC85_near.hss
  1999. --- gnuexts/SEC85_near.hss 2003-09-16 16:47:30.000000000 +0200
  2000. +++ fix/gnuexts/SEC85_near.hss 1970-01-01 01:00:00.000000000 +0100
  2001. @@ -1,8 +0,0 @@
  2002. -[Main]
  2003. -Title=near
  2004. -
  2005. -[Top]
  2006. -On 68HC11 and 68HC12 the <CODE>near</CODE> attribute causes the compiler to
  2007. -use the normal calling convention based on <CODE>jsr</CODE> and <CODE>rts</CODE>.
  2008. -This attribute can be used to cancel the effect of the <B>'-mlong-calls'</B>
  2009. -option.
  2010. diff -Nur gnuexts/SEC85_nonnull.hss fix/gnuexts/SEC85_nonnull.hss
  2011. --- gnuexts/SEC85_nonnull.hss 2003-09-16 16:47:28.000000000 +0200
  2012. +++ fix/gnuexts/SEC85_nonnull.hss 2003-09-17 01:26:00.000000000 +0200
  2013. @@ -2,6 +2,8 @@
  2014. Title=nonnull
  2015. [Top]
  2016. +Syntax: <B>nonnull [(<I>param1</I>[, <I>param2</I>[, ...]])]</B>
  2017. +<BR><BR>
  2018. The <CODE>nonnull</CODE> attribute specifies that some function parameters should
  2019. be non-null pointers. For instance, the declaration:
  2020. <PRE>extern void *
  2021. diff -Nur gnuexts/SEC85_noreturn.hss fix/gnuexts/SEC85_noreturn.hss
  2022. --- gnuexts/SEC85_noreturn.hss 2003-09-16 16:47:26.000000000 +0200
  2023. +++ fix/gnuexts/SEC85_noreturn.hss 2003-09-16 22:56:08.000000000 +0200
  2024. @@ -2,10 +2,10 @@
  2025. Title=noreturn
  2026. [Top]
  2027. -A few standard library functions, such as <CODE>abort</CODE> and <CODE>exit</CODE>,
  2028. -cannot return. GCC knows this automatically. Some programs define
  2029. +A few standard library functions, such as <A HREF="$$LINK(stdlib.h/abort)">abort</A> and <A HREF="$$LINK(stdlib.h/exit)">exit</A>,
  2030. +cannot return. Some programs define
  2031. their own functions that never return. You can declare them
  2032. -<CODE>noreturn</CODE> to tell the compiler this fact. For example,
  2033. +<CODE>noreturn</CODE> to tell the compiler this fact. For example:
  2034. <PRE>void fatal () __attribute__ ((noreturn));
  2035. void
  2036. @@ -16,8 +16,8 @@
  2037. }
  2038. </PRE>
  2039. The <CODE>noreturn</CODE> keyword tells the compiler to assume that
  2040. -<CODE>fatal</CODE> cannot return. It can then optimize without regard to what
  2041. -would happen if <CODE>fatal</CODE> ever did return. This makes slightly
  2042. +<I>fatal</I> cannot return. It can then optimize without regard to what
  2043. +would happen if <I>fatal</I> ever did return. This makes slightly
  2044. better code. More importantly, it helps avoid spurious warnings of
  2045. uninitialized variables.
  2046. <BR><BR>
  2047. @@ -25,13 +25,4 @@
  2048. restored before calling the <CODE>noreturn</CODE> function.
  2049. <BR><BR>
  2050. It does not make sense for a <CODE>noreturn</CODE> function to have a return
  2051. -type other than <CODE>void</CODE>.
  2052. -<BR><BR>
  2053. -The attribute <CODE>noreturn</CODE> is not implemented in GCC versions
  2054. -earlier than 2.5. An alternative way to declare that a function does
  2055. -not return, which works in the current version and in some older
  2056. -versions, is as follows:
  2057. -<PRE>typedef void voidfn ();
  2058. -
  2059. -volatile voidfn fatal;
  2060. -</PRE>
  2061. +type other than <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>.
  2062. diff -Nur gnuexts/SEC85_nothrow.hss fix/gnuexts/SEC85_nothrow.hss
  2063. --- gnuexts/SEC85_nothrow.hss 2003-09-16 16:47:26.000000000 +0200
  2064. +++ fix/gnuexts/SEC85_nothrow.hss 2003-09-17 01:28:30.000000000 +0200
  2065. @@ -3,8 +3,6 @@
  2066. [Top]
  2067. The <CODE>nothrow</CODE> attribute is used to inform the compiler that a
  2068. -function cannot throw an exception. For example, most functions in
  2069. -the standard C library can be guaranteed not to throw an exception
  2070. -with the notable exceptions of <CODE>qsort</CODE> and <CODE>bsearch</CODE> that
  2071. -take function pointer arguments. The <CODE>nothrow</CODE> attribute is not
  2072. -implemented in GCC versions earlier than 3.2.
  2073. +function cannot throw an exception.
  2074. +This is probably useless in TIGCC, as it implements its own error-handling
  2075. +mechanism.
  2076. diff -Nur gnuexts/SEC85_protected.hss fix/gnuexts/SEC85_protected.hss
  2077. --- gnuexts/SEC85_protected.hss 2003-09-16 16:47:28.000000000 +0200
  2078. +++ fix/gnuexts/SEC85_protected.hss 1970-01-01 01:00:00.000000000 +0100
  2079. @@ -1,8 +0,0 @@
  2080. -[Main]
  2081. -Title=protected
  2082. -
  2083. -[Top]
  2084. -Protected visibility indicates that the symbol will be placed in the
  2085. -dynamic symbol table, but that references within the defining module
  2086. -will bind to the local symbol. That is, the symbol cannot be overridden
  2087. -by another module.
  2088. diff -Nur gnuexts/SEC85_pure.hss fix/gnuexts/SEC85_pure.hss
  2089. --- gnuexts/SEC85_pure.hss 2003-09-16 16:47:26.000000000 +0200
  2090. +++ fix/gnuexts/SEC85_pure.hss 2003-09-16 22:56:08.000000000 +0200
  2091. @@ -1,5 +1,6 @@
  2092. [Main]
  2093. Title=pure
  2094. +See Also=SEC85_const: const
  2095. [Top]
  2096. Many functions have no effects except the return value and their
  2097. @@ -10,13 +11,10 @@
  2098. with the attribute <CODE>pure</CODE>. For example,
  2099. <PRE>int square (int) __attribute__ ((pure));
  2100. </PRE>
  2101. -says that the hypothetical function <CODE>square</CODE> is safe to call
  2102. +says that the hypothetical function <I>square</I> is safe to call
  2103. fewer times than the program says.
  2104. <BR><BR>
  2105. -Some of common examples of pure functions are <CODE>strlen</CODE> or <CODE>memcmp</CODE>.
  2106. +Some common examples of pure functions are <A HREF="$$LINK(string.h/strlen)">strlen</A> or <A HREF="$$LINK(mem.h/memcmp)">memcmp</A>.
  2107. Interesting non-pure functions are functions with infinite loops or those
  2108. depending on volatile memory or other system resource, that may change between
  2109. -two consecutive calls (such as <CODE>feof</CODE> in a multithreading environment).
  2110. -<BR><BR>
  2111. -The attribute <CODE>pure</CODE> is not implemented in GCC versions earlier
  2112. -than 2.96.
  2113. +two consecutive calls.
  2114. diff -Nur gnuexts/SEC85_regparm.hss fix/gnuexts/SEC85_regparm.hss
  2115. --- gnuexts/SEC85_regparm.hss 2003-09-16 16:47:28.000000000 +0200
  2116. +++ fix/gnuexts/SEC85_regparm.hss 2003-09-17 00:57:24.000000000 +0200
  2117. @@ -1,19 +1,12 @@
  2118. [Main]
  2119. -Title=regparm
  2120. +Title=regparm, stkparm
  2121. +See Also=SEC99a: Specifying Registers for Function Parameters
  2122. [Top]
  2123. -On the Intel 386, the <CODE>regparm</CODE> attribute causes the compiler to
  2124. -pass up to <I>number</I> integer arguments in registers EAX,
  2125. -EDX, and ECX instead of on the stack. Functions that take a
  2126. -variable number of arguments will continue to be passed all of their
  2127. -arguments on the stack.
  2128. +Syntax: <B>regparm [(<I>regcount</I>)]</B> / <B>stkparm</B>
  2129. <BR><BR>
  2130. -Beware that on some ELF systems this attribute is unsuitable for
  2131. -global functions in shared libraries with lazy binding (which is the
  2132. -default). Lazy binding will send the first call via resolving code in
  2133. -the loader, which might assume EAX, EDX and ECX can be clobbered, as
  2134. -per the standard calling conventions. Solaris 8 is affected by this.
  2135. -GNU systems with GLIBC 2.1 or higher, and FreeBSD, are believed to be
  2136. -safe since the loaders there save all registers. (Lazy binding can be
  2137. -disabled with the linker or the loader if desired, to avoid the
  2138. -problem.)
  2139. +The <CODE>regparm</CODE> attribute causes the function to use <I>regcount</I>
  2140. +data registers and <I>regcount</I> address registers for parameters.
  2141. +<CODE>stkparm</CODE> means the exact opposite, i.e. all parameters are passed
  2142. +on the stack. The <B>'-mregparm'</B> switch specifies which one is the default,
  2143. +and the default for <I>regcount</I>.
  2144. diff -Nur gnuexts/SEC85_section.hss fix/gnuexts/SEC85_section.hss
  2145. --- gnuexts/SEC85_section.hss 2003-09-16 16:47:28.000000000 +0200
  2146. +++ fix/gnuexts/SEC85_section.hss 2003-09-16 22:56:08.000000000 +0200
  2147. @@ -2,16 +2,18 @@
  2148. Title=section
  2149. [Top]
  2150. -Normally, the compiler places the code it generates in the <CODE>text</CODE> section.
  2151. +Syntax: <B>section (&quot;<I>section-name</I>&quot;)</B>
  2152. +<BR><BR>
  2153. +Normally, the compiler places all code and data it generates in the <CODE>.data</CODE> section.
  2154. Sometimes, however, you need additional sections, or you need certain
  2155. particular functions to appear in special sections. The <CODE>section</CODE>
  2156. attribute specifies that a function lives in a particular section.
  2157. For example, the declaration:
  2158. <PRE>extern void foobar (void) __attribute__ ((section (&quot;bar&quot;)));
  2159. </PRE>
  2160. -puts the function <CODE>foobar</CODE> in the <CODE>bar</CODE> section.
  2161. +puts the function <I>foobar</I> in the <CODE>bar</CODE> section.
  2162. +<BR><BR>
  2163. +The use of this attribute is limited in TIGCC, because its linker supports
  2164. +only a few types of sections.
  2165. <BR><BR>
  2166. -Some file formats do not support arbitrary sections so the <CODE>section</CODE>
  2167. -attribute is not available on all platforms.
  2168. -If you need to map the entire contents of a module to a particular
  2169. -section, consider using the facilities of the linker instead.
  2170. +The <CODE>section</CODE> attribute can also be used for <A HREF="$$LINK(SEC91_section)">variables</A>.
  2171. diff -Nur gnuexts/SEC85_signal.hss fix/gnuexts/SEC85_signal.hss
  2172. --- gnuexts/SEC85_signal.hss 2003-09-16 16:47:30.000000000 +0200
  2173. +++ fix/gnuexts/SEC85_signal.hss 1970-01-01 01:00:00.000000000 +0100
  2174. @@ -1,8 +0,0 @@
  2175. -[Main]
  2176. -Title=signal
  2177. -
  2178. -[Top]
  2179. -Use this attribute on the AVR to indicate that the specified
  2180. -function is an signal handler. The compiler will generate function
  2181. -entry and exit sequences suitable for use in an signal handler when this
  2182. -attribute is present. Interrupts will be disabled inside function.
  2183. diff -Nur gnuexts/SEC85_sp_switch.hss fix/gnuexts/SEC85_sp_switch.hss
  2184. --- gnuexts/SEC85_sp_switch.hss 2003-09-16 16:47:30.000000000 +0200
  2185. +++ fix/gnuexts/SEC85_sp_switch.hss 1970-01-01 01:00:00.000000000 +0100
  2186. @@ -1,12 +0,0 @@
  2187. -[Main]
  2188. -Title=sp_switch
  2189. -
  2190. -[Top]
  2191. -Use this attribute on the SH to indicate an <CODE>interrupt_handler</CODE>
  2192. -function should switch to an alternate stack. It expects a string
  2193. -argument that names a global variable holding the address of the
  2194. -alternate stack.
  2195. -<PRE>void *alt_stack;
  2196. -void f () __attribute__ ((interrupt_handler,
  2197. - sp_switch (&quot;alt_stack&quot;)));
  2198. -</PRE>
  2199. diff -Nur gnuexts/SEC85_stdcall.hss fix/gnuexts/SEC85_stdcall.hss
  2200. --- gnuexts/SEC85_stdcall.hss 2003-09-16 16:47:28.000000000 +0200
  2201. +++ fix/gnuexts/SEC85_stdcall.hss 1970-01-01 01:00:00.000000000 +0100
  2202. @@ -1,10 +0,0 @@
  2203. -[Main]
  2204. -Title=stdcall
  2205. -
  2206. -[Top]
  2207. -On the Intel 386, the <CODE>stdcall</CODE> attribute causes the compiler to
  2208. -assume that the called function will pop off the stack space used to
  2209. -pass arguments, unless it takes a variable number of arguments.
  2210. -<BR><BR>
  2211. -The PowerPC compiler for Windows NT currently ignores the <CODE>stdcall</CODE>
  2212. -attribute.
  2213. diff -Nur gnuexts/SEC85_tiny_data.hss fix/gnuexts/SEC85_tiny_data.hss
  2214. --- gnuexts/SEC85_tiny_data.hss 2003-09-16 16:47:30.000000000 +0200
  2215. +++ fix/gnuexts/SEC85_tiny_data.hss 1970-01-01 01:00:00.000000000 +0100
  2216. @@ -1,9 +0,0 @@
  2217. -[Main]
  2218. -Title=tiny_data
  2219. -
  2220. -[Top]
  2221. -Use this attribute on the H8/300H to indicate that the specified
  2222. -variable should be placed into the tiny data section.
  2223. -The compiler will generate more efficient code for loads and stores
  2224. -on data in the tiny data section. Note the tiny data area is limited to
  2225. -slightly under 32kbytes of data.
  2226. diff -Nur gnuexts/SEC85_tls_model.hss fix/gnuexts/SEC85_tls_model.hss
  2227. --- gnuexts/SEC85_tls_model.hss 2003-09-16 16:47:28.000000000 +0200
  2228. +++ fix/gnuexts/SEC85_tls_model.hss 1970-01-01 01:00:00.000000000 +0100
  2229. @@ -1,20 +0,0 @@
  2230. -[Main]
  2231. -Title=tls_model
  2232. -
  2233. -[Top]
  2234. -The <CODE>visibility</CODE> attribute on ELF targets causes the declaration
  2235. -to be emitted with default, hidden, protected or internal visibility.
  2236. -<PRE>void __attribute__ ((visibility (&quot;protected&quot;)))
  2237. -f () { /* Do something. */; }
  2238. -int i __attribute__ ((visibility (&quot;hidden&quot;)));
  2239. -</PRE>
  2240. -See the ELF gABI for complete details, but the short story is:
  2241. -<BR><BR>
  2242. -Not all ELF targets support this attribute.
  2243. -<BR><BR>
  2244. -The <CODE>tls_model</CODE> attribute sets thread-local storage model
  2245. -(see <A HREF="$$INFOLINK(Thread-Local)">Thread-Local</A>) of a particular <CODE>__thread</CODE> variable,
  2246. -overriding <B>'-ftls-model='</B> command line switch on a per-variable
  2247. -basis.
  2248. -The <I>tls_model</I> argument should be one of <CODE>global-dynamic</CODE>,
  2249. -<CODE>local-dynamic</CODE>, <CODE>initial-exec</CODE> or <CODE>local-exec</CODE>.
  2250. diff -Nur gnuexts/SEC85_trap_exit.hss fix/gnuexts/SEC85_trap_exit.hss
  2251. --- gnuexts/SEC85_trap_exit.hss 2003-09-16 16:47:30.000000000 +0200
  2252. +++ fix/gnuexts/SEC85_trap_exit.hss 1970-01-01 01:00:00.000000000 +0100
  2253. @@ -1,7 +0,0 @@
  2254. -[Main]
  2255. -Title=trap_exit
  2256. -
  2257. -[Top]
  2258. -Use this attribute on the SH for an <CODE>interrupt_handle</CODE> to return using
  2259. -<CODE>trapa</CODE> instead of <CODE>rte</CODE>. This attribute expects an integer
  2260. -argument specifying the trap number to be used.
  2261. diff -Nur gnuexts/SEC85_unused.hss fix/gnuexts/SEC85_unused.hss
  2262. --- gnuexts/SEC85_unused.hss 2003-09-16 16:47:28.000000000 +0200
  2263. +++ fix/gnuexts/SEC85_unused.hss 2003-09-16 22:56:08.000000000 +0200
  2264. @@ -4,5 +4,7 @@
  2265. [Top]
  2266. This attribute, attached to a function, means that the function is meant
  2267. to be possibly unused. GCC will not produce a warning for this
  2268. -function. GNU C++ does not currently support this attribute as
  2269. -definitions without parameters are valid in C++.
  2270. +function.
  2271. +<BR><BR>
  2272. +The <CODE>unused</CODE> attribute can also be used for <A HREF="$$LINK(SEC91_unused)">variables</A> and
  2273. +<A HREF="$$LINK(SEC92_unused)">types</A>.
  2274. diff -Nur gnuexts/SEC85_weak.hss fix/gnuexts/SEC85_weak.hss
  2275. --- gnuexts/SEC85_weak.hss 2003-09-16 16:47:28.000000000 +0200
  2276. +++ fix/gnuexts/SEC85_weak.hss 1970-01-01 01:00:00.000000000 +0100
  2277. @@ -1,10 +0,0 @@
  2278. -[Main]
  2279. -Title=weak
  2280. -
  2281. -[Top]
  2282. -The <CODE>weak</CODE> attribute causes the declaration to be emitted as a weak
  2283. -symbol rather than a global. This is primarily useful in defining
  2284. -library functions which can be overridden in user code, though it can
  2285. -also be used with non-function declarations. Weak symbols are supported
  2286. -for ELF targets, and also for a.out targets when using the GNU assembler
  2287. -and linker.
  2288. diff -Nur gnuexts/SEC85a.hss fix/gnuexts/SEC85a.hss
  2289. --- gnuexts/SEC85a.hss 2003-09-16 16:47:32.000000000 +0200
  2290. +++ fix/gnuexts/SEC85a.hss 2003-09-16 22:56:08.000000000 +0200
  2291. @@ -4,18 +4,10 @@
  2292. [Top]
  2293. This section describes the syntax with which <CODE>__attribute__</CODE> may be
  2294. used, and the constructs to which attribute specifiers bind, for the C
  2295. -language. Some details may vary for C++ and Objective-C. Because of
  2296. +language. Because of
  2297. infelicities in the grammar for attributes, some forms described here
  2298. may not be successfully parsed in all cases.
  2299. <BR><BR>
  2300. -There are some problems with the semantics of attributes in C++. For
  2301. -example, there are no manglings for attributes, although they may affect
  2302. -code generation, so problems may arise when attributed types are used in
  2303. -conjunction with templates or overloading. Similarly, <CODE>typeid</CODE>
  2304. -does not distinguish between types with different attributes. Support
  2305. -for attributes in C++ may be restricted in future to attributes on
  2306. -declarations only, but not on nested declarators.
  2307. -<BR><BR>
  2308. See <A HREF="$$LINK(SEC85)">Function Attributes</A> for details of the semantics of attributes
  2309. applying to functions. See <A HREF="$$LINK(SEC91)">Variable Attributes</A> for details of the
  2310. semantics of attributes applying to variables. See <A HREF="$$LINK(SEC92)">Type Attributes</A>
  2311. diff -Nur gnuexts/SEC86.hss fix/gnuexts/SEC86.hss
  2312. --- gnuexts/SEC86.hss 2003-09-16 16:47:32.000000000 +0200
  2313. +++ fix/gnuexts/SEC86.hss 2003-09-16 22:56:08.000000000 +0200
  2314. @@ -22,11 +22,11 @@
  2315. return x == 0;
  2316. }
  2317. </PRE>
  2318. -Suppose the type <CODE>uid_t</CODE> happens to be <CODE>short</CODE>. ISO C does
  2319. +Suppose the type <CODE>uid_t</CODE> happens to be <CODE><A HREF="$$INFOLINK(keywords/char)">char</A></CODE>. ISO C does
  2320. not allow this example, because subword arguments in old-style
  2321. non-prototype definitions are promoted. Therefore in this example the
  2322. -function definition's argument is really an <CODE>int</CODE>, which does not
  2323. -match the prototype argument type of <CODE>short</CODE>.
  2324. +function definition's argument is really an <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>, which does not
  2325. +match the prototype argument type of <CODE><A HREF="$$INFOLINK(keywords/char)">char</A></CODE>.
  2326. <BR><BR>
  2327. This restriction of ISO C makes it hard to write code that is portable
  2328. to traditional C compilers, because the programmer does not know
  2329. @@ -45,5 +45,3 @@
  2330. return x == 0;
  2331. }
  2332. </PRE>
  2333. -GNU C++ does not support old-style function definitions, so this
  2334. -extension is irrelevant.
  2335. diff -Nur gnuexts/SEC88.hss fix/gnuexts/SEC88.hss
  2336. --- gnuexts/SEC88.hss 2003-09-16 16:47:32.000000000 +0200
  2337. +++ fix/gnuexts/SEC88.hss 2003-09-16 22:56:08.000000000 +0200
  2338. @@ -4,5 +4,3 @@
  2339. [Top]
  2340. In GNU C, you may normally use dollar signs in identifier names.
  2341. This is because many traditional C implementations allow such identifiers.
  2342. -However, dollar signs in identifiers are not supported on a few target
  2343. -machines, typically because the target assembler does not allow them.
  2344. diff -Nur gnuexts/SEC89.hss fix/gnuexts/SEC89.hss
  2345. --- gnuexts/SEC89.hss 2003-09-16 16:47:32.000000000 +0200
  2346. +++ fix/gnuexts/SEC89.hss 2003-09-16 22:56:08.000000000 +0200
  2347. @@ -1,6 +1,6 @@
  2348. [Main]
  2349. -Title=The Character @key{ESC} in Constants
  2350. +Title=Escape Character in Constants
  2351. [Top]
  2352. You can use the sequence <CODE>\e</CODE> in a string or character constant to
  2353. -stand for the ASCII character ESC.
  2354. +stand for the ASCII character ESC (<CODE>\x1B</CODE>).
  2355. diff -Nur gnuexts/SEC90.hss fix/gnuexts/SEC90.hss
  2356. --- gnuexts/SEC90.hss 2003-09-16 16:47:32.000000000 +0200
  2357. +++ fix/gnuexts/SEC90.hss 2003-09-16 22:56:10.000000000 +0200
  2358. @@ -4,25 +4,18 @@
  2359. [Top]
  2360. The keyword <CODE>__alignof__</CODE> allows you to inquire about how an object
  2361. is aligned, or the minimum alignment usually required by a type. Its
  2362. -syntax is just like <CODE>sizeof</CODE>.
  2363. +syntax is just like <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE>.
  2364. <BR><BR>
  2365. -For example, if the target machine requires a <CODE>double</CODE> value to be
  2366. -aligned on an 8-byte boundary, then <CODE>__alignof__&nbsp;(double)</CODE> is 8.
  2367. -This is true on many RISC machines. On more traditional machine
  2368. -designs, <CODE>__alignof__&nbsp;(double)</CODE> is 4 or even 2.
  2369. -<BR><BR>
  2370. -Some machines never actually require alignment; they allow reference to any
  2371. -data type even at an odd addresses. For these machines, <CODE>__alignof__</CODE>
  2372. -reports the <I>recommended</I> alignment of a type.
  2373. +In TIGCC, <CODE>__alignof__&nbsp;(<I>anything</I>)</CODE> is always 2, except for
  2374. +<CODE><A HREF="$$INFOLINK(keywords/char)">char</A></CODE> variables.
  2375. <BR><BR>
  2376. If the operand of <CODE>__alignof__</CODE> is an lvalue rather than a type,
  2377. its value is the required alignment for its type, taking into account
  2378. -any minimum alignment specified with GCC's <CODE>__attribute__</CODE>
  2379. -extension (see <A HREF="$$LINK(SEC91)">Variable Attributes</A>). For example, after this
  2380. +any minimum alignment specified with GCC's <CODE><A HREF="$$LINK(SEC91_aligned)">aligned</A></CODE> attribute. For example, after this
  2381. declaration:
  2382. <PRE>struct foo { int x; char y; } foo1;
  2383. </PRE>
  2384. the value of <CODE>__alignof__&nbsp;(foo1.y)</CODE> is 1, even though its actual
  2385. -alignment is probably 2 or 4, the same as <CODE>__alignof__&nbsp;(int)</CODE>.
  2386. +alignment is 2, the same as <CODE>__alignof__&nbsp;(int)</CODE>.
  2387. <BR><BR>
  2388. It is an error to ask for the alignment of an incomplete type.
  2389. diff -Nur gnuexts/SEC91.hss fix/gnuexts/SEC91.hss
  2390. --- gnuexts/SEC91.hss 2003-09-16 16:47:34.000000000 +0200
  2391. +++ fix/gnuexts/SEC91.hss 2003-09-17 01:14:22.000000000 +0200
  2392. @@ -1,18 +1,18 @@
  2393. [Main]
  2394. Title=Specifying Attributes of Variables
  2395. +Subsections=SEC91_aligned, SEC91_mode, SEC91_nocommon, SEC91_packed, SEC91_section, SEC91_transparent_union, SEC91_cleanup, SEC91_unused, SEC91_deprecated
  2396. +Index=__attribute__
  2397. [Top]
  2398. The keyword <CODE>__attribute__</CODE> allows you to specify special
  2399. attributes of variables or structure fields. This keyword is followed
  2400. -by an attribute specification inside double parentheses. Ten
  2401. -attributes are currently defined for variables: <CODE>aligned</CODE>,
  2402. -<CODE>mode</CODE>, <CODE>nocommon</CODE>, <CODE>packed</CODE>, <CODE>section</CODE>,
  2403. -<CODE>transparent_union</CODE>, <CODE>unused</CODE>, <CODE>deprecated</CODE>,
  2404. -<CODE>vector_size</CODE>, and <CODE>weak</CODE>. Some other attributes are defined
  2405. -for variables on particular target systems. Other attributes are
  2406. +by an attribute specification inside double parentheses.
  2407. +The following attributes are currently defined for variables:
  2408. +
  2409. +[Bottom]
  2410. +Other attributes are
  2411. available for functions (see <A HREF="$$LINK(SEC85)">Function Attributes</A>) and for types
  2412. -(see <A HREF="$$LINK(SEC92)">Type Attributes</A>). Other front ends might define more
  2413. -attributes (see <A HREF="$$INFOLINK(C++ Extensions,,Extensions to the C++ Language)">Extensions to the C++ Language</A>).
  2414. +(see <A HREF="$$LINK(SEC92)">Type Attributes</A>).
  2415. <BR><BR>
  2416. You may also specify attributes with <CODE>__</CODE> preceding and following
  2417. each keyword. This allows you to use them in header files without
  2418. diff -Nur gnuexts/SEC91_aligned.hss fix/gnuexts/SEC91_aligned.hss
  2419. --- gnuexts/SEC91_aligned.hss 2003-09-16 16:47:32.000000000 +0200
  2420. +++ fix/gnuexts/SEC91_aligned.hss 2003-09-16 22:56:10.000000000 +0200
  2421. @@ -2,22 +2,19 @@
  2422. Title=aligned
  2423. [Top]
  2424. +Syntax: <B>aligned [(<I>alignment</I>)]</B>
  2425. +<BR><BR>
  2426. This attribute specifies a minimum alignment for the variable or
  2427. structure field, measured in bytes. For example, the declaration:
  2428. -<PRE>int x __attribute__ ((aligned (16))) = 0;
  2429. +<PRE>int x __attribute__ ((aligned (4))) = 0;
  2430. </PRE>
  2431. causes the compiler to allocate the global variable <CODE>x</CODE> on a
  2432. -16-byte boundary. On a 68040, this could be used in conjunction with
  2433. -an <CODE>asm</CODE> expression to access the <CODE>move16</CODE> instruction which
  2434. -requires 16-byte aligned operands.
  2435. +4-byte boundary.
  2436. <BR><BR>
  2437. You can also specify the alignment of structure fields. For example, to
  2438. -create a double-word aligned <CODE>int</CODE> pair, you could write:
  2439. -<PRE>struct foo { int x[2] __attribute__ ((aligned (8))); };
  2440. +create a 4-byte aligned <CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE> pair, you could write:
  2441. +<PRE>struct foo { int x[2] __attribute__ ((aligned (4))); };
  2442. </PRE>
  2443. -This is an alternative to creating a union with a <CODE>double</CODE> member
  2444. -that forces the union to be double-word aligned.
  2445. -<BR><BR>
  2446. As in the preceding examples, you can explicitly specify the alignment
  2447. (in bytes) that you wish the compiler to use for a given variable or
  2448. structure field. Alternatively, you can leave out the alignment factor
  2449. @@ -29,19 +26,8 @@
  2450. Whenever you leave out the alignment factor in an <CODE>aligned</CODE> attribute
  2451. specification, the compiler automatically sets the alignment for the declared
  2452. variable or field to the largest alignment which is ever used for any data
  2453. -type on the target machine you are compiling for. Doing this can often make
  2454. -copy operations more efficient, because the compiler can use whatever
  2455. -instructions copy the biggest chunks of memory when performing copies to
  2456. -or from the variables or fields that you have aligned this way.
  2457. +type on the target machine you are compiling for (useless in TIGCC, since everything
  2458. +is already aligned well enough with the default 2-byte alignment).
  2459. <BR><BR>
  2460. The <CODE>aligned</CODE> attribute can only increase the alignment; but you
  2461. -can decrease it by specifying <CODE>packed</CODE> as well. See below.
  2462. -<BR><BR>
  2463. -Note that the effectiveness of <CODE>aligned</CODE> attributes may be limited
  2464. -by inherent limitations in your linker. On many systems, the linker is
  2465. -only able to arrange for variables to be aligned up to a certain maximum
  2466. -alignment. (For some linkers, the maximum supported alignment may
  2467. -be very very small.) If your linker is only able to align variables
  2468. -up to a maximum of 8 byte alignment, then specifying <CODE>aligned(16)</CODE>
  2469. -in an <CODE>__attribute__</CODE> will still only provide you with 8 byte
  2470. -alignment. See your linker documentation for further information.
  2471. +can decrease it by specifying <CODE><A HREF="$$LINK(SEC91_packed)">packed</A></CODE> as well.
  2472. diff -Nur gnuexts/SEC91_cleanup.hss fix/gnuexts/SEC91_cleanup.hss
  2473. --- gnuexts/SEC91_cleanup.hss 2003-09-16 16:47:32.000000000 +0200
  2474. +++ fix/gnuexts/SEC91_cleanup.hss 2003-09-17 01:13:38.000000000 +0200
  2475. @@ -13,5 +13,7 @@
  2476. will be run during the stack unwinding that happens during the
  2477. processing of the exception. Note that the <CODE>cleanup</CODE> attribute
  2478. does not allow the exception to be caught, only to perform an action.
  2479. +Note that TIGCC defines its own error handling mechanism, so this attribute
  2480. +will not work if used in this way.
  2481. It is undefined what happens if <I>cleanup_function</I> does not
  2482. return normally.
  2483. diff -Nur gnuexts/SEC91_deprecated.hss fix/gnuexts/SEC91_deprecated.hss
  2484. --- gnuexts/SEC91_deprecated.hss 2003-09-16 16:47:34.000000000 +0200
  2485. +++ fix/gnuexts/SEC91_deprecated.hss 2003-09-16 22:56:10.000000000 +0200
  2486. @@ -15,5 +15,5 @@
  2487. </PRE>
  2488. results in a warning on line 3 but not line 2.
  2489. <BR><BR>
  2490. -The <CODE>deprecated</CODE> attribute can also be used for functions and
  2491. -types (see <A HREF="$$LINK(SEC85)">Function Attributes</A> See <A HREF="$$LINK(SEC92)">Type Attributes</A>.)
  2492. +The <CODE>deprecated</CODE> attribute can also be used for <A HREF="$$LINK(SEC85_deprecated)">functions</A> and
  2493. +<A HREF="$$LINK(SEC92_deprecated)">types</A>.
  2494. diff -Nur gnuexts/SEC91_mode.hss fix/gnuexts/SEC91_mode.hss
  2495. --- gnuexts/SEC91_mode.hss 2003-09-16 16:47:32.000000000 +0200
  2496. +++ fix/gnuexts/SEC91_mode.hss 2003-09-16 22:56:10.000000000 +0200
  2497. @@ -2,6 +2,8 @@
  2498. Title=mode
  2499. [Top]
  2500. +Syntax: <B>mode (<I>mode</I>)</B>
  2501. +<BR><BR>
  2502. This attribute specifies the data type for the declaration - whichever
  2503. type corresponds to the mode <I>mode</I>. This in effect lets you
  2504. request an integer or floating point type according to its width.
  2505. diff -Nur gnuexts/SEC91_model.hss fix/gnuexts/SEC91_model.hss
  2506. --- gnuexts/SEC91_model.hss 2003-09-16 16:47:34.000000000 +0200
  2507. +++ fix/gnuexts/SEC91_model.hss 1970-01-01 01:00:00.000000000 +0100
  2508. @@ -1,14 +0,0 @@
  2509. -[Main]
  2510. -Title=model
  2511. -
  2512. -[Top]
  2513. -Use this attribute on the M32R/D to set the addressability of an object.
  2514. -The identifier <I>model-name</I> is one of <CODE>small</CODE>, <CODE>medium</CODE>,
  2515. -or <CODE>large</CODE>, representing each of the code models.
  2516. -<BR><BR>
  2517. -Small model objects live in the lower 16MB of memory (so that their
  2518. -addresses can be loaded with the <CODE>ld24</CODE> instruction).
  2519. -<BR><BR>
  2520. -Medium and large model objects may live anywhere in the 32-bit address space
  2521. -(the compiler will generate <CODE>seth/add3</CODE> instructions to load their
  2522. -addresses).
  2523. diff -Nur gnuexts/SEC91_nocommon.hss fix/gnuexts/SEC91_nocommon.hss
  2524. --- gnuexts/SEC91_nocommon.hss 2003-09-16 16:47:32.000000000 +0200
  2525. +++ fix/gnuexts/SEC91_nocommon.hss 2003-09-16 22:56:10.000000000 +0200
  2526. @@ -2,7 +2,7 @@
  2527. Title=nocommon
  2528. [Top]
  2529. -This attribute specifies requests GCC not to place a variable
  2530. +This attribute requests GCC not to place a variable
  2531. &quot;common&quot; but instead to allocate space for it directly. If you
  2532. specify the <B>'-fno-common'</B> flag, GCC will do this for all
  2533. variables.
  2534. diff -Nur gnuexts/SEC91_section.hss fix/gnuexts/SEC91_section.hss
  2535. --- gnuexts/SEC91_section.hss 2003-09-16 16:47:34.000000000 +0200
  2536. +++ fix/gnuexts/SEC91_section.hss 2003-09-16 22:56:10.000000000 +0200
  2537. @@ -2,12 +2,16 @@
  2538. Title=section
  2539. [Top]
  2540. +Syntax: <B>section (&quot;<I>section-name</I>&quot;)</B>
  2541. +<BR><BR>
  2542. Normally, the compiler places the objects it generates in sections like
  2543. -<CODE>data</CODE> and <CODE>bss</CODE>. Sometimes, however, you need additional sections,
  2544. +<CODE>.data</CODE> and <CODE>.bss</CODE>. Sometimes, however, you need additional sections,
  2545. or you need certain particular variables to appear in special sections,
  2546. for example to map to special hardware. The <CODE>section</CODE>
  2547. attribute specifies that a variable (or function) lives in a particular
  2548. -section. For example, this small program uses several specific section names:
  2549. +section. The use of this attribute is limited in TIGCC, because its linker supports
  2550. +only a few types of sections, but this may be improved in the future.
  2551. +For example, this small hypothetical program uses several specific section names:
  2552. <PRE>struct duart a __attribute__ ((section (&quot;DUART_A&quot;))) = { 0 };
  2553. struct duart b __attribute__ ((section (&quot;DUART_B&quot;))) = { 0 };
  2554. char stack[10000] __attribute__ ((section (&quot;STACK&quot;))) = { 0 };
  2555. @@ -34,12 +38,9 @@
  2556. You may only use the <CODE>section</CODE> attribute with a fully initialized
  2557. global definition because of the way linkers work. The linker requires
  2558. each object be defined once, with the exception that uninitialized
  2559. -variables tentatively go in the <CODE>common</CODE> (or <CODE>bss</CODE>) section
  2560. +variables tentatively go in the <CODE>.bss</CODE> section
  2561. and can be multiply &quot;defined&quot;. You can force a variable to be
  2562. -initialized with the <B>'-fno-common'</B> flag or the <CODE>nocommon</CODE>
  2563. +initialized with the <B>'-fno-common'</B> flag or the <CODE><A HREF="$$LINK(SEC91_nocommon)">nocommon</A></CODE>
  2564. attribute.
  2565. <BR><BR>
  2566. -Some file formats do not support arbitrary sections so the <CODE>section</CODE>
  2567. -attribute is not available on all platforms.
  2568. -If you need to map the entire contents of a module to a particular
  2569. -section, consider using the facilities of the linker instead.
  2570. +The <CODE>section</CODE> attribute can also be used for <A HREF="$$LINK(SEC85_section)">functions</A>.
  2571. diff -Nur gnuexts/SEC91_shared.hss fix/gnuexts/SEC91_shared.hss
  2572. --- gnuexts/SEC91_shared.hss 2003-09-16 16:47:34.000000000 +0200
  2573. +++ fix/gnuexts/SEC91_shared.hss 1970-01-01 01:00:00.000000000 +0100
  2574. @@ -1,24 +0,0 @@
  2575. -[Main]
  2576. -Title=shared
  2577. -
  2578. -[Top]
  2579. -On Windows NT, in addition to putting variable definitions in a named
  2580. -section, the section can also be shared among all running copies of an
  2581. -executable or DLL. For example, this small program defines shared data
  2582. -by putting it in a named section <CODE>shared</CODE> and marking the section
  2583. -shareable:
  2584. -<PRE>int foo __attribute__((section (&quot;shared&quot;), shared)) = 0;
  2585. -
  2586. -int
  2587. -main()
  2588. -{
  2589. - /* Read and write foo. All running
  2590. - copies see the same value. */
  2591. - return 0;
  2592. -}
  2593. -</PRE>
  2594. -You may only use the <CODE>shared</CODE> attribute along with <CODE>section</CODE>
  2595. -attribute with a fully initialized global definition because of the way
  2596. -linkers work. See <CODE>section</CODE> attribute for more information.
  2597. -<BR><BR>
  2598. -The <CODE>shared</CODE> attribute is only available on Windows NT.
  2599. diff -Nur gnuexts/SEC91_transparent_union.hss fix/gnuexts/SEC91_transparent_union.hss
  2600. --- gnuexts/SEC91_transparent_union.hss 2003-09-16 16:47:34.000000000 +0200
  2601. +++ fix/gnuexts/SEC91_transparent_union.hss 2003-09-16 22:56:10.000000000 +0200
  2602. @@ -5,6 +5,8 @@
  2603. This attribute, attached to a function parameter which is a union, means
  2604. that the corresponding argument may have the type of any union member,
  2605. but the argument is passed as if its type were that of the first union
  2606. -member. For more details see <A HREF="$$LINK(SEC92)">Type Attributes</A>. You can also use
  2607. -this attribute on a <CODE>typedef</CODE> for a union data type; then it
  2608. +member. For more details, see the
  2609. +<CODE><A HREF="$$LINK(SEC92_transparent_union)">transparent_union</A></CODE>
  2610. +type attribute. You can also use
  2611. +this attribute on a <CODE><A HREF="$$INFOLINK(keywords/typedef)">typedef</A></CODE> for a union data type; then it
  2612. applies to all function parameters with that type.
  2613. diff -Nur gnuexts/SEC91_unused.hss fix/gnuexts/SEC91_unused.hss
  2614. --- gnuexts/SEC91_unused.hss 2003-09-16 16:47:34.000000000 +0200
  2615. +++ fix/gnuexts/SEC91_unused.hss 2003-09-16 22:56:10.000000000 +0200
  2616. @@ -5,3 +5,6 @@
  2617. This attribute, attached to a variable, means that the variable is meant
  2618. to be possibly unused. GCC will not produce a warning for this
  2619. variable.
  2620. +<BR><BR>
  2621. +The <CODE>unused</CODE> attribute can also be used for <A HREF="$$LINK(SEC85_unused)">functions</A> and
  2622. +<A HREF="$$LINK(SEC92_unused)">types</A>.
  2623. diff -Nur gnuexts/SEC91_vector_size.hss fix/gnuexts/SEC91_vector_size.hss
  2624. --- gnuexts/SEC91_vector_size.hss 2003-09-16 16:47:34.000000000 +0200
  2625. +++ fix/gnuexts/SEC91_vector_size.hss 1970-01-01 01:00:00.000000000 +0100
  2626. @@ -1,23 +0,0 @@
  2627. -[Main]
  2628. -Title=vector_size
  2629. -
  2630. -[Top]
  2631. -This attribute specifies the vector size for the variable, measured in
  2632. -bytes. For example, the declaration:
  2633. -<PRE>int foo __attribute__ ((vector_size (16)));
  2634. -</PRE>
  2635. -causes the compiler to set the mode for <CODE>foo</CODE>, to be 16 bytes,
  2636. -divided into <CODE>int</CODE> sized units. Assuming a 32-bit int (a vector of
  2637. -4 units of 4 bytes), the corresponding mode of <CODE>foo</CODE> will be V4SI.
  2638. -<BR><BR>
  2639. -This attribute is only applicable to integral and float scalars,
  2640. -although arrays, pointers, and function return values are allowed in
  2641. -conjunction with this construct.
  2642. -<BR><BR>
  2643. -Aggregates with this attribute are invalid, even if they are of the same
  2644. -size as a corresponding scalar. For example, the declaration:
  2645. -<PRE>struct S { int a; };
  2646. -struct S __attribute__ ((vector_size (16))) foo;
  2647. -</PRE>
  2648. -is invalid even if the size of the structure is the same as the size of
  2649. -the <CODE>int</CODE>.
  2650. diff -Nur gnuexts/SEC91_weak.hss fix/gnuexts/SEC91_weak.hss
  2651. --- gnuexts/SEC91_weak.hss 2003-09-16 16:47:34.000000000 +0200
  2652. +++ fix/gnuexts/SEC91_weak.hss 1970-01-01 01:00:00.000000000 +0100
  2653. @@ -1,5 +0,0 @@
  2654. -[Main]
  2655. -Title=weak
  2656. -
  2657. -[Top]
  2658. -The <CODE>weak</CODE> attribute is described in <A HREF="$$LINK(SEC85)">Function Attributes</A>.
  2659. diff -Nur gnuexts/SEC92.hss fix/gnuexts/SEC92.hss
  2660. --- gnuexts/SEC92.hss 2003-09-16 16:47:36.000000000 +0200
  2661. +++ fix/gnuexts/SEC92.hss 2003-09-17 01:15:10.000000000 +0200
  2662. @@ -1,13 +1,17 @@
  2663. [Main]
  2664. Title=Specifying Attributes of Types
  2665. +Subsections=SEC92_aligned, SEC92_packed, SEC92_transparent_union, SEC92_may_alias, SEC92_unused, SEC92_deprecated
  2666. +Index=__attribute__
  2667. [Top]
  2668. The keyword <CODE>__attribute__</CODE> allows you to specify special
  2669. -attributes of <CODE>struct</CODE> and <CODE>union</CODE> types when you define such
  2670. +attributes of <CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A></CODE> and <CODE><A HREF="$$INFOLINK(keywords/union)">union</A></CODE> types when you define such
  2671. types. This keyword is followed by an attribute specification inside
  2672. -double parentheses. Six attributes are currently defined for types:
  2673. -<CODE>aligned</CODE>, <CODE>packed</CODE>, <CODE>transparent_union</CODE>, <CODE>unused</CODE>,
  2674. -<CODE>deprecated</CODE> and <CODE>may_alias</CODE>. Other attributes are defined for
  2675. +double parentheses.
  2676. +The following attributes are currently defined for types:
  2677. +
  2678. +[Bottom]
  2679. +Other attributes are defined for
  2680. functions (see <A HREF="$$LINK(SEC85)">Function Attributes</A>) and for variables
  2681. (see <A HREF="$$LINK(SEC91)">Variable Attributes</A>).
  2682. <BR><BR>
  2683. diff -Nur gnuexts/SEC92_aligned.hss fix/gnuexts/SEC92_aligned.hss
  2684. --- gnuexts/SEC92_aligned.hss 2003-09-16 16:47:36.000000000 +0200
  2685. +++ fix/gnuexts/SEC92_aligned.hss 2003-09-17 01:03:04.000000000 +0200
  2686. @@ -2,6 +2,8 @@
  2687. Title=aligned
  2688. [Top]
  2689. +Syntax: <B>aligned [(<I>alignment</I>)]</B>
  2690. +<BR><BR>
  2691. This attribute specifies a minimum alignment (in bytes) for variables
  2692. of the specified type. For example, the declarations:
  2693. <PRE>struct S { short f[3]; } __attribute__ ((aligned (8)));
  2694. @@ -9,13 +11,9 @@
  2695. </PRE>
  2696. force the compiler to insure (as far as it can) that each variable whose
  2697. type is <CODE>struct&nbsp;S</CODE> or <CODE>more_aligned_int</CODE> will be allocated and
  2698. -aligned <I>at least</I> on a 8-byte boundary. On a SPARC, having all
  2699. -variables of type <CODE>struct&nbsp;S</CODE> aligned to 8-byte boundaries allows
  2700. -the compiler to use the <CODE>ldd</CODE> and <CODE>std</CODE> (doubleword load and
  2701. -store) instructions when copying one variable of type <CODE>struct&nbsp;S</CODE> to
  2702. -another, thus improving run-time efficiency.
  2703. +aligned <I>at least</I> on a 8-byte boundary.
  2704. <BR><BR>
  2705. -Note that the alignment of any given <CODE>struct</CODE> or <CODE>union</CODE> type
  2706. +Note that the alignment of any given <CODE><A HREF="$$INFOLINK(keywords/struct)">struct</A></CODE> or <CODE><A HREF="$$INFOLINK(keywords/union)">union</A></CODE> type
  2707. is required by the ISO C standard to be at least a perfect multiple of
  2708. the lowest common multiple of the alignments of all of the members of
  2709. the <CODE>struct</CODE> or <CODE>union</CODE> in question. This means that you <I>can</I>
  2710. @@ -36,38 +34,8 @@
  2711. Whenever you leave out the alignment factor in an <CODE>aligned</CODE>
  2712. attribute specification, the compiler automatically sets the alignment
  2713. for the type to the largest alignment which is ever used for any data
  2714. -type on the target machine you are compiling for. Doing this can often
  2715. -make copy operations more efficient, because the compiler can use
  2716. -whatever instructions copy the biggest chunks of memory when performing
  2717. -copies to or from the variables which have types that you have aligned
  2718. -this way.
  2719. -<BR><BR>
  2720. -In the example above, if the size of each <CODE>short</CODE> is 2 bytes, then
  2721. -the size of the entire <CODE>struct&nbsp;S</CODE> type is 6 bytes. The smallest
  2722. -power of two which is greater than or equal to that is 8, so the
  2723. -compiler sets the alignment for the entire <CODE>struct&nbsp;S</CODE> type to 8
  2724. -bytes.
  2725. -<BR><BR>
  2726. -Note that although you can ask the compiler to select a time-efficient
  2727. -alignment for a given type and then declare only individual stand-alone
  2728. -objects of that type, the compiler's ability to select a time-efficient
  2729. -alignment is primarily useful only when you plan to create arrays of
  2730. -variables having the relevant (efficiently aligned) type. If you
  2731. -declare or use arrays of variables of an efficiently-aligned type, then
  2732. -it is likely that your program will also be doing pointer arithmetic (or
  2733. -subscripting, which amounts to the same thing) on pointers to the
  2734. -relevant type, and the code that the compiler generates for these
  2735. -pointer arithmetic operations will often be more efficient for
  2736. -efficiently-aligned types than for other types.
  2737. +type on the target machine you are compiling for (useless in TIGCC, since everything
  2738. +is already aligned well enough with the default 2-byte alignment).
  2739. <BR><BR>
  2740. The <CODE>aligned</CODE> attribute can only increase the alignment; but you
  2741. -can decrease it by specifying <CODE>packed</CODE> as well. See below.
  2742. -<BR><BR>
  2743. -Note that the effectiveness of <CODE>aligned</CODE> attributes may be limited
  2744. -by inherent limitations in your linker. On many systems, the linker is
  2745. -only able to arrange for variables to be aligned up to a certain maximum
  2746. -alignment. (For some linkers, the maximum supported alignment may
  2747. -be very very small.) If your linker is only able to align variables
  2748. -up to a maximum of 8 byte alignment, then specifying <CODE>aligned(16)</CODE>
  2749. -in an <CODE>__attribute__</CODE> will still only provide you with 8 byte
  2750. -alignment. See your linker documentation for further information.
  2751. +can decrease it by specifying <CODE><A HREF="$$LINK(SEC91_packed)">packed</A></CODE> as well.
  2752. diff -Nur gnuexts/SEC92_deprecated.hss fix/gnuexts/SEC92_deprecated.hss
  2753. --- gnuexts/SEC92_deprecated.hss 2003-09-16 16:47:36.000000000 +0200
  2754. +++ fix/gnuexts/SEC92_deprecated.hss 2003-09-16 22:56:10.000000000 +0200
  2755. @@ -23,5 +23,5 @@
  2756. deprecated. Line 5 has no warning because T3 is explicitly
  2757. deprecated. Similarly for line 6.
  2758. <BR><BR>
  2759. -The <CODE>deprecated</CODE> attribute can also be used for functions and
  2760. -variables (see <A HREF="$$LINK(SEC85)">Function Attributes</A> See <A HREF="$$LINK(SEC91)">Variable Attributes</A>.)
  2761. +The <CODE>deprecated</CODE> attribute can also be used for <A HREF="$$LINK(SEC85_deprecated)">functions</A> and
  2762. +<A HREF="$$LINK(SEC91_deprecated)">variables</A>.
  2763. diff -Nur gnuexts/SEC92_may_alias.hss fix/gnuexts/SEC92_may_alias.hss
  2764. --- gnuexts/SEC92_may_alias.hss 2003-09-16 16:47:36.000000000 +0200
  2765. +++ fix/gnuexts/SEC92_may_alias.hss 2003-09-17 01:18:24.000000000 +0200
  2766. @@ -4,16 +4,15 @@
  2767. [Top]
  2768. Accesses to objects with types with this attribute are not subjected to
  2769. type-based alias analysis, but are instead assumed to be able to alias
  2770. -any other type of objects, just like the <CODE>char</CODE> type. See
  2771. +any other type of objects, just like the <CODE><A HREF="$$INFOLINK(keywords/char)">char</A></CODE> type. See
  2772. <B>'-fstrict-aliasing'</B> for more information on aliasing issues.
  2773. <BR><BR>
  2774. Example of use:
  2775. <PRE>typedef short __attribute__((__may_alias__)) short_a;
  2776. -int
  2777. -main (void)
  2778. +void _main (void)
  2779. {
  2780. - int a = 0x12345678;
  2781. + long a = 0x12345678;
  2782. short_a *b = (short_a *) &amp;a;
  2783. b[1] = 0;
  2784. @@ -21,7 +20,7 @@
  2785. if (a == 0x12345678)
  2786. abort();
  2787. - exit(0);
  2788. + /* ... */
  2789. }
  2790. </PRE>
  2791. If you replaced <CODE>short_a</CODE> with <CODE>short</CODE> in the variable
  2792. diff -Nur gnuexts/SEC92_transparent_union.hss fix/gnuexts/SEC92_transparent_union.hss
  2793. --- gnuexts/SEC92_transparent_union.hss 2003-09-16 16:47:36.000000000 +0200
  2794. +++ fix/gnuexts/SEC92_transparent_union.hss 2003-09-16 22:56:10.000000000 +0200
  2795. @@ -2,7 +2,7 @@
  2796. Title=transparent_union
  2797. [Top]
  2798. -This attribute, attached to a <CODE>union</CODE> type definition, indicates
  2799. +This attribute, attached to a <CODE><A HREF="$$INFOLINK(keywords/union)">union</A></CODE> type definition, indicates
  2800. that any function parameter having that union type causes calls to that
  2801. function to be treated in a special way.
  2802. <BR><BR>
  2803. @@ -11,7 +11,7 @@
  2804. a pointer type, the corresponding argument can be a null pointer
  2805. constant or a void pointer expression; and if the union contains a void
  2806. pointer type, the corresponding argument can be any pointer expression.
  2807. -If the union member type is a pointer, qualifiers like <CODE>const</CODE> on
  2808. +If the union member type is a pointer, qualifiers like <CODE><A HREF="$$INFOLINK(keywords/const)">const</A></CODE> on
  2809. the referenced type must be respected, just as with normal pointer
  2810. conversions.
  2811. <BR><BR>
  2812. @@ -22,31 +22,5 @@
  2813. to work properly.
  2814. <BR><BR>
  2815. Transparent unions are designed for library functions that have multiple
  2816. -interfaces for compatibility reasons. For example, suppose the
  2817. -<CODE>wait</CODE> function must accept either a value of type <CODE>int&nbsp;*</CODE> to
  2818. -comply with Posix, or a value of type <CODE>union&nbsp;wait&nbsp;*</CODE> to comply with
  2819. -the 4.1BSD interface. If <CODE>wait</CODE>'s parameter were <CODE>void&nbsp;*</CODE>,
  2820. -<CODE>wait</CODE> would accept both kinds of arguments, but it would also
  2821. -accept any other pointer type and this would make argument type checking
  2822. -less useful. Instead, <CODE>&lt;sys/wait.h&gt;</CODE> might define the interface
  2823. -as follows:
  2824. -<PRE>typedef union
  2825. - {
  2826. - int *__ip;
  2827. - union wait *__up;
  2828. - } wait_status_ptr_t __attribute__ ((__transparent_union__));
  2829. -
  2830. -pid_t wait (wait_status_ptr_t);
  2831. -</PRE>
  2832. -This interface allows either <CODE>int&nbsp;*</CODE> or <CODE>union&nbsp;wait&nbsp;*</CODE>
  2833. -arguments to be passed, using the <CODE>int&nbsp;*</CODE> calling convention.
  2834. -The program can call <CODE>wait</CODE> with arguments of either type:
  2835. -<PRE>int w1 () { int w; return wait (&amp;w); }
  2836. -int w2 () { union wait w; return wait (&amp;w); }
  2837. -</PRE>
  2838. -With this interface, <CODE>wait</CODE>'s implementation might look like this:
  2839. -<PRE>pid_t wait (wait_status_ptr_t p)
  2840. -{
  2841. - return waitpid (-1, p.__ip, 0);
  2842. -}
  2843. -</PRE>
  2844. +interfaces for compatibility reasons, but they may be used for various
  2845. +different purposes.
  2846. diff -Nur gnuexts/SEC92_unused.hss fix/gnuexts/SEC92_unused.hss
  2847. --- gnuexts/SEC92_unused.hss 2003-09-16 16:47:36.000000000 +0200
  2848. +++ fix/gnuexts/SEC92_unused.hss 2003-09-16 22:56:10.000000000 +0200
  2849. @@ -5,7 +5,7 @@
  2850. When attached to a type (including a <CODE>union</CODE> or a <CODE>struct</CODE>),
  2851. this attribute means that variables of that type are meant to appear
  2852. possibly unused. GCC will not produce a warning for any variables of
  2853. -that type, even if the variable appears to do nothing. This is often
  2854. -the case with lock or thread classes, which are usually defined and then
  2855. -not referenced, but contain constructors and destructors that have
  2856. -nontrivial bookkeeping functions.
  2857. +that type, even if the variable appears to do nothing.
  2858. +<BR><BR>
  2859. +The <CODE>unused</CODE> attribute can also be used for <A HREF="$$LINK(SEC85_unused)">functions</A> and
  2860. +<A HREF="$$LINK(SEC91_unused)">variables</A>.
  2861. diff -Nur gnuexts/SEC93.hss fix/gnuexts/SEC93.hss
  2862. --- gnuexts/SEC93.hss 2003-09-16 16:47:36.000000000 +0200
  2863. +++ fix/gnuexts/SEC93.hss 2003-09-16 22:56:10.000000000 +0200
  2864. @@ -1,5 +1,6 @@
  2865. [Main]
  2866. -Title=An Inline Function is As Fast As a Macro
  2867. +Title=Inline Functions
  2868. +Index=inline, __inline__
  2869. [Top]
  2870. By declaring a function <CODE>inline</CODE>, you can direct GCC to
  2871. @@ -31,22 +32,17 @@
  2872. <B>'-finline-functions'</B>.
  2873. <BR><BR>
  2874. Note that certain usages in a function definition can make it unsuitable
  2875. -for inline substitution. Among these usages are: use of varargs, use of
  2876. -alloca, use of variable sized data types (see <A HREF="$$LINK(SEC76)">Variable Length</A>),
  2877. +for inline substitution. Among these usages are: use of a variable number of arguments, use of
  2878. +<A HREF="$$LINK(alloc.h/alloca)">alloca</A>, use of variable sized data types (see <A HREF="$$LINK(SEC76)">Variable Length Arrays</A>),
  2879. use of computed goto (see <A HREF="$$LINK(SEC65)">Labels as Values</A>), use of nonlocal goto,
  2880. and nested functions (see <A HREF="$$LINK(SEC66)">Nested Functions</A>). Using <B>'-Winline'</B>
  2881. will warn when a function marked <CODE>inline</CODE> could not be substituted,
  2882. and will give the reason for the failure.
  2883. <BR><BR>
  2884. -Note that in C and Objective-C, unlike C++, the <CODE>inline</CODE> keyword
  2885. +Note that in C (unlike C++), the <CODE>inline</CODE> keyword
  2886. does not affect the linkage of the function.
  2887. <BR><BR>
  2888. -GCC automatically inlines member functions defined within the class
  2889. -body of C++ programs even if they are not explicitly declared
  2890. -<CODE>inline</CODE>. (You can override this with <B>'-fno-default-inline'</B>;
  2891. -see <A HREF="$$INFOLINK(C++ Dialect Options,,Options Controlling C++ Dialect)">Options Controlling C++ Dialect</A>.)
  2892. -<BR><BR>
  2893. -When a function is both inline and <CODE>static</CODE>, if all calls to the
  2894. +When a function is both inline and <CODE><A HREF="$$INFOLINK(keywords/static)">static</A></CODE>, if all calls to the
  2895. function are integrated into the caller, and the function's address is
  2896. never used, then the function's own assembler code is never referenced.
  2897. In this case, GCC does not actually output assembler code for the
  2898. @@ -58,14 +54,14 @@
  2899. usual. The function must also be compiled as usual if the program
  2900. refers to its address, because that can't be inlined.
  2901. <BR><BR>
  2902. -When an inline function is not <CODE>static</CODE>, then the compiler must assume
  2903. +When an inline function is not <CODE><A HREF="$$INFOLINK(keywords/static)">static</A></CODE>, then the compiler must assume
  2904. that there may be calls from other source files; since a global symbol can
  2905. be defined only once in any program, the function must not be defined in
  2906. the other source files, so the calls therein cannot be integrated.
  2907. -Therefore, a non-<CODE>static</CODE> inline function is always compiled on its
  2908. +Therefore, a non-<CODE><A HREF="$$INFOLINK(keywords/static)">static</A></CODE> inline function is always compiled on its
  2909. own in the usual fashion.
  2910. <BR><BR>
  2911. -If you specify both <CODE>inline</CODE> and <CODE>extern</CODE> in the function
  2912. +If you specify both <CODE>inline</CODE> and <CODE><A HREF="$$INFOLINK(keywords/extern)">extern</A></CODE> in the function
  2913. definition, then the definition is used only for inlining. In no case
  2914. is the function compiled on its own, not even if you refer to its
  2915. address explicitly. Such an address becomes an external reference, as
  2916. @@ -86,7 +82,7 @@
  2917. that will implement the C99 semantics, though it does not do so yet.)
  2918. <BR><BR>
  2919. GCC does not inline any functions when not optimizing unless you specify
  2920. -the <CODE>always_inline</CODE> attribute for the function, like this:
  2921. +the <CODE><A HREF="$$LINK(SEC85_always_inline)">always_inline</A></CODE> attribute for the function, like this:
  2922. <PRE>/* Prototype. */
  2923. -inline void foo (const char) __attribute__((always_inline));
  2924. +inline void foo (const char*) __attribute__((always_inline));
  2925. </PRE>
  2926. diff -Nur gnuexts/SEC94.hss fix/gnuexts/SEC94.hss
  2927. --- gnuexts/SEC94.hss 2003-09-16 16:47:38.000000000 +0200
  2928. +++ fix/gnuexts/SEC94.hss 2003-09-16 22:56:10.000000000 +0200
  2929. @@ -11,15 +11,25 @@
  2930. appears in a machine description, plus an operand constraint string for
  2931. each operand.
  2932. <BR><BR>
  2933. -For example, here is how to use the 68881's <CODE>fsinx</CODE> instruction:
  2934. +For the beginning, you will be given here a very illustrative example on how to use the 68881's
  2935. +<CODE>fsinx</CODE> instruction (note that this example is not applicable to TI calculators,
  2936. +because the MC68000 processor which is built into the TI-89 and TI-92+ does not have this
  2937. +instruction, but the example is illustrative anyway):
  2938. <PRE>asm (&quot;fsinx %1,%0&quot; : &quot;=f&quot; (result) : &quot;f&quot; (angle));
  2939. </PRE>
  2940. -Here <CODE>angle</CODE> is the C expression for the input operand while
  2941. -<CODE>result</CODE> is that of the output operand. Each has <CODE>&quot;f&quot;</CODE> as its
  2942. +Here <I>angle</I> is the C expression for the input operand while
  2943. +<I>result</I> is that of the output operand. Each has <CODE>&quot;f&quot;</CODE> as its
  2944. operand constraint, saying that a floating point register is required.
  2945. The <CODE>=</CODE> in <CODE>=f</CODE> indicates that the operand is an output; all
  2946. output operands' constraints must use <CODE>=</CODE>. The constraints use the
  2947. -same language used in the machine description (see <A HREF="$$INFOLINK(Constraints)">Constraints</A>).
  2948. +same language used in the machine description (see the section <A HREF="$$LINK(SEC95)">Operand Constraints</A>).
  2949. +In this example,
  2950. +the compiler will convert this instruction into a sequence of assembly instructions
  2951. +which will ensure that the evaluated expression <I>angle</I> is really stored in
  2952. +one of the 68881's floating point registers, and which will store the result of the <CODE>fsinx</CODE>
  2953. +(which is in some other floating point register) into the expression <I>result</I>
  2954. +(note that <I>result</I> need not be a variable; it can be any lvalue expression, for
  2955. +example a dereferenced pointer).
  2956. <BR><BR>
  2957. Each operand is described by an operand-constraint string followed by
  2958. the C expression in parentheses. A colon separates the assembler
  2959. @@ -61,9 +71,33 @@
  2960. will use the register as the output of the <CODE>asm</CODE>, and then store
  2961. that register into the output.
  2962. <BR><BR>
  2963. +Here is an another example, which is applicable to TIGCC. Suppose that we
  2964. +want to rotate the value of the expression <I>input</I> one bit to the left, and
  2965. +to store the result into the expression <I>output</I> (which is an lvalue).
  2966. +We can write the following code:
  2967. +<PRE>asm ("move.l %1,%%d0; rol #1,%%d0; move.l %%d0,%0" : "=g" (output) : "g" (input));
  2968. +</PRE>
  2969. +Note that when extended asm constructions are used, the percent sign before the
  2970. +register names must be doubled. It is important to say that in the above example
  2971. +<I>input</I> and <I>output</I> may be any valid expressions; in the simple case
  2972. +when both of them are just global variables, a simple asm construction like
  2973. +<PRE>asm ("move.l input,%d0; rol #1,%d0; move.l %d0,output");
  2974. +</PRE>
  2975. +would be quite enough. Extended asm constructions allow encapsulating them in macros
  2976. +which look like functions, like in the following example, which defines a macro <CODE>'rotate'</CODE>
  2977. +which acts like a void function:
  2978. +<PRE>#define rotate(input, output) \
  2979. +({ asm ("move.l %1,%%d0; rol #1,%%d0; move.l %%d0,%0" \
  2980. +: "=g" (output) : "g" (input)); })
  2981. +</PRE>
  2982. The ordinary output operands must be write-only; GCC will assume that
  2983. the values in these operands before the instruction are dead and need
  2984. -not be generated. Extended asm supports input-output or read-write
  2985. +not be generated. That's why the following version of <CODE>'rotate'</CODE>
  2986. +macro which accepts just one argument (and which rotates it one bit to the left)
  2987. +is quite unreliable:
  2988. +<PRE>#define rotate(inout) ({ asm ("rol #1,%0" : "=d" (inout)); })
  2989. +</PRE>
  2990. +To solve such difficulties, extended asm supports input-output or read-write
  2991. operands. Use the constraint character <CODE>+</CODE> to indicate such an
  2992. operand and list it with the output operands.
  2993. <BR><BR>
  2994. @@ -104,14 +138,16 @@
  2995. : [result] &quot;=r&quot;(result)
  2996. : &quot;r&quot; (test), &quot;r&quot;(new), &quot;[result]&quot;(old));
  2997. </PRE>
  2998. -Some instructions clobber specific hard registers. To describe this,
  2999. +All the examples given above have a serious drawback: they clobber the register <CODE>'d0'</CODE>.
  3000. +If the compiler keeps something important in it (which is very likely), this may cause lots
  3001. +of trouble. Of course,
  3002. +you can save it on the stack at the beginning and restore it at the end, but there is a much better
  3003. +solution which will save clobbered registers only when necessary. To describe clobbered registers,
  3004. write a third colon after the input operands, followed by the names of
  3005. -the clobbered hard registers (given as strings). Here is a realistic
  3006. -example for the VAX:
  3007. -<PRE>asm volatile (&quot;movc3 %0,%1,%2&quot;
  3008. - : /* no outputs */
  3009. - : &quot;g&quot; (from), &quot;g&quot; (to), &quot;g&quot; (count)
  3010. - : &quot;r0&quot;, &quot;r1&quot;, &quot;r2&quot;, &quot;r3&quot;, &quot;r4&quot;, &quot;r5&quot;);
  3011. +the clobbered registers (given as strings), separated by commas:
  3012. +<PRE>#define rotate(input, output) \
  3013. +({ asm ("move.l %1,%%d0; rol #1,%%d0; move.l %%d0,%0" \
  3014. +: "=g" (output) : "g" (input) : "d0"); })
  3015. </PRE>
  3016. You may not write a clobber description in a way that overlaps with an
  3017. input or output operand. For example, you may not have an operand
  3018. @@ -126,12 +162,23 @@
  3019. <CODE>volatile</CODE> for the <CODE>asm</CODE> construct, as described below, to
  3020. prevent GCC from deleting the <CODE>asm</CODE> statement as unused.
  3021. <BR><BR>
  3022. -If you refer to a particular hardware register from the assembler code,
  3023. +Whenever you refer to a particular hardware register from the assembler code,
  3024. you will probably have to list the register after the third colon to
  3025. -tell the compiler the register's value is modified. In some assemblers,
  3026. -the register names begin with <CODE>%</CODE>; to produce one <CODE>%</CODE> in the
  3027. -assembler code, you must write <CODE>%%</CODE> in the input.
  3028. -<BR><BR>
  3029. +tell the compiler the register's value is modified.
  3030. +Alternatively, you can force the compiler to use any data register instead of
  3031. +<CODE>'d0'</CODE>, using the following trick:
  3032. +<PRE>#define rotate(input, output) \
  3033. +({ register long __temp; \
  3034. +asm ("move.l %1,%2; rol #1,%2; move.l %2,%0" \
  3035. +: "=g" (output) : "g" (input), "d" (__temp)); })
  3036. +</PRE>
  3037. +Here, the <CODE>"d"</CODE> constraint ensures that <CODE>'__temp'</CODE> will be stored in
  3038. +the data register (note that <CODE>rol</CODE> is applicable only to data registers).
  3039. +In fact, there is no need for a temporary register if we forced the output to be in
  3040. +a data register, which can be implemented as in the following example:
  3041. +<PRE>#define rotate(input, output) \
  3042. +({ asm ("move.l %1,%0; rol #1,%0" : "=d" (output) : "g" (input)); })
  3043. +</PRE>
  3044. If your assembler instruction can alter the condition code register, add
  3045. <CODE>cc</CODE> to the list of clobbered registers. GCC on some machines
  3046. represents the condition codes as a specific hardware register;
  3047. @@ -147,55 +194,54 @@
  3048. inputs or outputs of the <CODE>asm</CODE>, as the <CODE>memory</CODE> clobber does
  3049. not count as a side-effect of the <CODE>asm</CODE>.
  3050. <BR><BR>
  3051. -You can put multiple assembler instructions together in a single
  3052. -<CODE>asm</CODE> template, separated by the characters normally used in assembly
  3053. -code for the system. A combination that works in most places is a newline
  3054. -to break the line, plus a tab character to move to the instruction field
  3055. -(written as <CODE>\n\t</CODE>). Sometimes semicolons can be used, if the
  3056. -assembler allows semicolons as a line-breaking character. Note that some
  3057. -assembler dialects use semicolons to start a comment.
  3058. +As already mentioned above, you can put multiple assembler instructions together in a single
  3059. +<CODE>asm</CODE> template, separated either with newlines or with semicolons
  3060. +(the GNU assembler allows semicolons as a line-breaking character).
  3061. The input operands are guaranteed not to use any of the clobbered
  3062. registers, and neither will the output operands' addresses, so you can
  3063. read and write the clobbered registers as many times as you like. Here
  3064. is an example of multiple instructions in a template; it assumes the
  3065. -subroutine <CODE>_foo</CODE> accepts arguments in registers 9 and 10:
  3066. -<PRE>asm (&quot;movl %0,r9\n\tmovl %1,r10\n\tcall _foo&quot;
  3067. - : /* no outputs */
  3068. - : &quot;g&quot; (from), &quot;g&quot; (to)
  3069. - : &quot;r9&quot;, &quot;r10&quot;);
  3070. +subroutine <CODE>_foo</CODE> accepts arguments in registers a0 and a1:
  3071. +<PRE>asm ("move.l %0,%%a0; move.l %1,%%a1; jsr _foo"
  3072. +: /* no outputs */
  3073. +: "g" (from), "g" (to)
  3074. +: "a0", "a1");
  3075. </PRE>
  3076. -Unless an output operand has the <CODE>&amp;</CODE> constraint modifier, GCC
  3077. +Unless an output operand has the <CODE>'&amp;'</CODE> constraint modifier, GCC
  3078. may allocate it in the same register as an unrelated input operand, on
  3079. the assumption the inputs are consumed before the outputs are produced.
  3080. This assumption may be false if the assembler code actually consists of
  3081. -more than one instruction. In such a case, use <CODE>&amp;</CODE> for each output
  3082. -operand that may not overlap an input. See <A HREF="$$INFOLINK(Modifiers)">Modifiers</A>.
  3083. +more than one instruction. In such a case, use <CODE>'&amp;'</CODE> for each output
  3084. +operand that may not overlap an input. See the section <A HREF="$$LINK(SEC95_cmc)">Constraint Modifier Characters</A>.
  3085. <BR><BR>
  3086. If you want to test the condition code produced by an assembler
  3087. instruction, you must include a branch and a label in the <CODE>asm</CODE>
  3088. construct, as follows:
  3089. -<PRE>asm (&quot;clr %0\n\tfrob %1\n\tbeq 0f\n\tmov #1,%0\n0:&quot;
  3090. - : &quot;g&quot; (result)
  3091. - : &quot;g&quot; (input));
  3092. +<PRE>asm ("clr.l %0; test.l %1; beq 0f; moveq #1,%0; 0:"
  3093. +: "g" (result) : "g" (input));
  3094. </PRE>
  3095. -This assumes your assembler supports local labels, as the GNU assembler
  3096. -and most Unix assemblers do.
  3097. -<BR><BR>
  3098. +This assumes your assembler supports local labels, which is true for the
  3099. +<A HREF="$$INFOLINK(gnuasm)">GNU Assembler</A> (it uses the suffix <CODE>'f'</CODE> for forward and <CODE>'b'</CODE> for
  3100. +backward local labels; see the section about <A HREF="$$INFOLINK(gnuasm/SEC48L)">Local Symbol Names</A>).<BR><BR>
  3101. Speaking of labels, jumps from one <CODE>asm</CODE> to another are not
  3102. supported. The compiler's optimizers do not know about these jumps, and
  3103. therefore they cannot take account of them when deciding how to
  3104. optimize.
  3105. <BR><BR>
  3106. -Usually the most convenient way to use these <CODE>asm</CODE> instructions is to
  3107. -encapsulate them in macros that look like functions. For example,
  3108. -<PRE>#define sin(x) \
  3109. -({ double __value, __arg = (x); \
  3110. - asm (&quot;fsinx %1,%0&quot;: &quot;=f&quot; (__value): &quot;f&quot; (__arg)); \
  3111. - __value; })
  3112. +As already mentioned, usually the most convenient way to use these
  3113. +<CODE>asm</CODE> instructions is to encapsulate them in macros that look like
  3114. +functions. Here is an example of how to define a function-looking macro with
  3115. +a non-void return type:
  3116. +<PRE>#define rotate(x) \
  3117. +({ unsigned long __result, __arg=(x); \
  3118. +asm ("move.l %1,%0; rol #1,%0": "=d" (__result): "g" (__arg)); \
  3119. +__result; })
  3120. </PRE>
  3121. +This macro acts nearly exactly like a function which takes one <CODE>unsigned long</CODE>
  3122. +argument, and which returns an <CODE>unsigned long</CODE> result.
  3123. Here the variable <CODE>__arg</CODE> is used to make sure that the instruction
  3124. -operates on a proper <CODE>double</CODE> value, and to accept only those
  3125. -arguments <CODE>x</CODE> which can convert automatically to a <CODE>double</CODE>.
  3126. +operates on a proper <CODE>unsigned long</CODE> value, and to accept only those
  3127. +arguments <CODE>x</CODE> which can convert automatically to an <CODE>unsigned long</CODE>.
  3128. <BR><BR>
  3129. Another way to make sure the instruction operates on the correct data
  3130. type is to use a cast in the <CODE>asm</CODE>. This is different from using a
  3131. @@ -215,7 +261,8 @@
  3132. appears not to change, the old value of the variable may be reused later
  3133. if it happens to be found in a register.
  3134. <BR><BR>
  3135. -You can prevent an <CODE>asm</CODE> instruction from being deleted, moved
  3136. +If you are not happy with this behavior,
  3137. +you can prevent an <CODE>asm</CODE> instruction from being deleted, moved
  3138. significantly, or combined, by writing the keyword <CODE>volatile</CODE> after
  3139. the <CODE>asm</CODE>. For example:
  3140. <PRE>#define get_and_set_priority(new) \
  3141. @@ -234,13 +281,15 @@
  3142. prove that control-flow will never reach the location of the
  3143. instruction.) In addition, GCC will not reschedule instructions
  3144. across a volatile <CODE>asm</CODE> instruction. For example:
  3145. -<PRE>*(volatile int *)addr = foo;
  3146. -asm volatile (&quot;eieio&quot; : : );
  3147. -</PRE>
  3148. -Assume <CODE>addr</CODE> contains the address of a memory mapped device
  3149. -register. The PowerPC <CODE>eieio</CODE> instruction (Enforce In-order
  3150. -Execution of I/O) tells the CPU to make sure that the store to that
  3151. -device register happens before it issues any other I/O.
  3152. +<PRE>#define inline_rowread(x) \
  3153. + ({*(short*)0x600018=(short)(x); \
  3154. + asm volatile("nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop":::"memory"); \
  3155. + ~(*(unsigned char*)0x60001b);})</PRE>
  3156. +Here, we can read the keyboard port at 0x60001b only 12 nops after setting
  3157. +the keyboard mask at 0x600018. Therefore, we need to make sure that the
  3158. +nops get scheduled between the write to 0x600018 and the read to 0x60001b.
  3159. +The <CODE>volatile</CODE> keyword makes sure that the instructions get ordered
  3160. +in the correct way.
  3161. <BR><BR>
  3162. Note that even a volatile <CODE>asm</CODE> instruction can be moved in ways
  3163. that appear insignificant to the compiler, such as across jump
  3164. @@ -268,6 +317,5 @@
  3165. an assembler instruction access to the condition code left by previous
  3166. instructions.
  3167. <BR><BR>
  3168. -If you are writing a header file that should be includable in ISO C
  3169. -programs, write <CODE>__asm__</CODE> instead of <CODE>asm</CODE>. See <A HREF="$$LINK(SEC100)">Alternate
  3170. -Keywords</A>.
  3171. +You can write write <CODE>__asm__</CODE> instead of <CODE>asm</CODE>.
  3172. +See section <A HREF="$$LINK(SEC100)">Alternate Keywords</A>.
  3173. diff -Nur gnuexts/SEC94_asm.hss fix/gnuexts/SEC94_asm.hss
  3174. --- gnuexts/SEC94_asm.hss 1970-01-01 01:00:00.000000000 +0100
  3175. +++ fix/gnuexts/SEC94_asm.hss 2003-09-16 22:56:10.000000000 +0200
  3176. @@ -0,0 +1,19 @@
  3177. +[Main]
  3178. +Title=Inline Assembler
  3179. +Subsections=SEC94_simple, SEC94, SEC95
  3180. +Index=asm, __asm__
  3181. +
  3182. +[Top]
  3183. +GCC introduces a special <CODE>asm</CODE> keyword to support assembler
  3184. +instructions within C code. Roughly, its syntax is:
  3185. +<PRE>asm (&quot;<I>instructions</I>&quot; [:<I>output</I>:<I>input</I>]);
  3186. +</PRE>
  3187. +The <CODE>asm</CODE> keyword may appear between usual lines of code or at
  3188. +the top level, outside of any function body. <I>instructions</I> may
  3189. +contain labels and references to global C symbols; in fact, the contents
  3190. +of the string are copied directly into the output file.
  3191. +
  3192. +[Bottom]
  3193. +If you are writing a header file that should be includable in programs compiled
  3194. +in GCC's strict ISO C mode, write <CODE>__asm__</CODE> instead of <CODE>asm</CODE>.
  3195. +See <A HREF="$$LINK(SEC100)">Alternate Keywords</A>.
  3196. diff -Nur gnuexts/SEC94_simple.hss fix/gnuexts/SEC94_simple.hss
  3197. --- gnuexts/SEC94_simple.hss 1970-01-01 01:00:00.000000000 +0100
  3198. +++ fix/gnuexts/SEC94_simple.hss 2003-09-16 22:56:10.000000000 +0200
  3199. @@ -0,0 +1,33 @@
  3200. +[Main]
  3201. +Title=Simple Inline Assembler Instructions
  3202. +
  3203. +[Top]
  3204. +The simplest form the <CODE>asm</CODE> keyword is:
  3205. +<PRE>asm (&quot;<I>instructions</I>&quot;);
  3206. +</PRE>
  3207. +where <I>instructions</I> contains one or more assembler instructions
  3208. +separated by semicolons or newlines.
  3209. +<BR><BR>
  3210. +In TIGCC, all register names must be preceded by a percent sign, to avoid
  3211. +confusion with C variables named like one of the CPU registers. For example:
  3212. +<PRE>asm (&quot;move.l 0xC8,%a0; move.l (%a0,1656),%a0; jsr (%a0)&quot;);
  3213. +</PRE>
  3214. +Hexadecimal constants must be written according to C syntax
  3215. +(like <CODE>0xC8</CODE>), not using the notation <CODE>$C8</CODE> which is
  3216. +common in various assemblers.
  3217. +<BR><BR>
  3218. +Note that something like
  3219. +<PRE>asm (&quot;move.l 0xC8,a0&quot;);
  3220. +</PRE>
  3221. +will be interpreted quite differently: <CODE>a0</CODE> will be regarded as a C language
  3222. +variable, not a register! Read the documentation about the <A HREF="$$INFOLINK(gnuasm)">GNU Assembler</A>
  3223. +for more information about the exact syntax and directives which it accepts;
  3224. +since inline assembler instructions are copied directly into the output of the
  3225. +compiler, exactly the same features are available.
  3226. +<BR><BR>
  3227. +Newlines as separators are also accepted in <I>instructions</I>, so the following code is valid as well:
  3228. +<PRE>asm (&quot; move.l 0xC8,%a0
  3229. + move.l (%a0,1656),%a0
  3230. + jsr (%a0)&quot;);
  3231. +</PRE>
  3232. +See <A HREF="$$LINK(SEC106)">Multi-line Strings</A> for more information.
  3233. diff -Nur gnuexts/SEC95.hss fix/gnuexts/SEC95.hss
  3234. --- gnuexts/SEC95.hss 1970-01-01 01:00:00.000000000 +0100
  3235. +++ fix/gnuexts/SEC95.hss 2003-09-16 22:56:10.000000000 +0200
  3236. @@ -0,0 +1,13 @@
  3237. +[Main]
  3238. +Title=Operand Constraints
  3239. +Subsections=SEC95_simple, SEC95_cmc
  3240. +
  3241. +[Top]
  3242. +Each match operand in an instruction pattern can specify a
  3243. +constraint for the type of operands allowed. Constraints can say whether
  3244. +an operand may be in a register, and which kinds of register; whether the
  3245. +operand can be a memory reference, and which kinds of address; whether the
  3246. +operand may be an immediate constant, and which possible values it may
  3247. +have. Constraints can also require two operands to match. Here, only those
  3248. +operand constraints which are valid for the Motorola 68000 processor and the
  3249. +built-in inline assembly will be described (i.e. those which are applicable to TIGCC).
  3250. diff -Nur gnuexts/SEC95_cmc.hss fix/gnuexts/SEC95_cmc.hss
  3251. --- gnuexts/SEC95_cmc.hss 1970-01-01 01:00:00.000000000 +0100
  3252. +++ fix/gnuexts/SEC95_cmc.hss 2003-09-16 22:56:10.000000000 +0200
  3253. @@ -0,0 +1,30 @@
  3254. +[Main]
  3255. +Title=Constraint Modifier Characters
  3256. +
  3257. +[Top]
  3258. +These are the constraint modifier characters which are meaningful for TIGCC:
  3259. +<DL>
  3260. +<DT><CODE>=</CODE>
  3261. +<DD>Means that this operand is write-only for this instruction: the previous
  3262. +value is discarded and replaced by output data.
  3263. +<BR><BR>
  3264. +<DT><CODE>+</CODE>
  3265. +<DD>Means that this operand is both read and written by the instruction.
  3266. +<BR><BR>
  3267. +When the compiler fixes up the operands to satisfy the constraints,
  3268. +it needs to know which operands are inputs to the instruction and
  3269. +which are outputs from it. <CODE>=</CODE> identifies an output; <CODE>+</CODE>
  3270. +identifies an operand that is both input and output; all other operands
  3271. +are assumed to be input only.
  3272. +<BR><BR>
  3273. +If you specify <CODE>=</CODE> or <CODE>+</CODE> in a constraint, you put it in the
  3274. +first character of the constraint string.
  3275. +<BR><BR>
  3276. +<DT><CODE>&amp;</CODE>
  3277. +<DD>Means (in a particular alternative) that this operand is an
  3278. +<B>earlyclobber</B> operand, which is modified before the instruction is
  3279. +finished using the input operands. Therefore, this operand may not lie
  3280. +in a register that is used as an input operand or as part of any memory
  3281. +address.
  3282. +<CODE>&amp;</CODE> does not obviate the need to write <CODE>=</CODE>.
  3283. +</DL>
  3284. diff -Nur gnuexts/SEC95_simple.hss fix/gnuexts/SEC95_simple.hss
  3285. --- gnuexts/SEC95_simple.hss 1970-01-01 01:00:00.000000000 +0100
  3286. +++ fix/gnuexts/SEC95_simple.hss 2003-09-16 22:56:10.000000000 +0200
  3287. @@ -0,0 +1,130 @@
  3288. +[Main]
  3289. +Title=Simple Constraints
  3290. +
  3291. +[Top]
  3292. +The simplest kind of constraint is a string full of letters, each of
  3293. +which describes one kind of operand that is permitted. These are
  3294. +the letters that are allowed:
  3295. +<DL>
  3296. +<DT><CODE>m</CODE>
  3297. +<DD>A memory operand is allowed, with any kind of address that the machine
  3298. +supports in general.
  3299. +<BR><BR>
  3300. +<DT><CODE>o</CODE>
  3301. +<DD>A memory operand is allowed, but only if the address is
  3302. +<U>offsettable</U>. This means that adding a small integer (actually,
  3303. +the width in bytes of the operand, as determined by its machine mode)
  3304. +may be added to the address and the result is also a valid memory
  3305. +address.
  3306. +For example, an address which is constant is offsettable; so is an
  3307. +address that is the sum of a register and a constant (as long as a
  3308. +slightly larger constant is also within the range of address-offsets
  3309. +supported by the machine); but an autoincrement or autodecrement
  3310. +address is not offsettable. More complicated indirect/indexed
  3311. +addresses may or may not be offsettable depending on the other
  3312. +addressing modes that the machine supports.
  3313. +<BR><BR>
  3314. +Note that in an output operand which can be matched by another
  3315. +operand, the constraint letter <CODE>o</CODE> is valid only when accompanied
  3316. +by both <CODE>&lt;</CODE> (if the target machine has predecrement addressing)
  3317. +and <CODE>&gt;</CODE> (if the target machine has preincrement addressing).
  3318. +<BR><BR>
  3319. +<DT><CODE>V</CODE>
  3320. +<DD>A memory operand that is not offsettable. In other words, anything that
  3321. +would fit the <CODE>m</CODE> constraint but not the <CODE>o</CODE> constraint.
  3322. +<BR><BR>
  3323. +<DT><CODE>&lt;</CODE>
  3324. +<DD>A memory operand with autodecrement addressing is allowed.
  3325. +<BR><BR>
  3326. +<DT><CODE>&gt;</CODE>
  3327. +<DD>A memory operand with autoincrement addressing is allowed.
  3328. +<BR><BR>
  3329. +<DT><CODE>r</CODE>
  3330. +<DD>A register operand is allowed provided that it is in a general
  3331. +register.
  3332. +<BR><BR>
  3333. +<DT><CODE>d</CODE>
  3334. +<DD>A data register is allowed. This is a Motorola-specific constraint.
  3335. +<BR><BR>
  3336. +<DT><CODE>a</CODE>
  3337. +<DD>An address register is allowed. This is a Motorola-specific constraint.
  3338. +<BR><BR>
  3339. +<DT><CODE>f</CODE>
  3340. +<DD>A 68881 floating-point register is allowed, if available (of course, it is not
  3341. +available on the TI-89 and TI-92 Plus). This is a Motorola-specific constraint.
  3342. +<BR><BR>
  3343. +<DT><CODE>i</CODE>
  3344. +<DD>An immediate integer operand (one with constant value) is allowed.
  3345. +This includes symbolic constants whose values will be known only at
  3346. +assembly time.
  3347. +<BR><BR>
  3348. +<DT><CODE>n</CODE>
  3349. +<DD>An immediate integer operand with a known numeric value is allowed.
  3350. +Many systems cannot support assembly-time constants for operands less
  3351. +than a word wide. Constraints for these operands should use <CODE>n</CODE>
  3352. +rather than <CODE>i</CODE>.
  3353. +<BR><BR>
  3354. +<DT><CODE>I</CODE>
  3355. +<DD>An integer in the range 1 to 8 is allowed. This is a Motorola-specific constraint, and this is
  3356. +for example the range permitted as a shift count in the shift instructions.
  3357. +<BR><BR>
  3358. +<DT><CODE>J</CODE>
  3359. +<DD>A 16 bit signed number is allowed. This is a Motorola-specific constraint.
  3360. +<BR><BR>
  3361. +<DT><CODE>K</CODE>
  3362. +<DD>A signed number whose magnitude is greater than 0x80 is allowed. This is a Motorola-specific constraint.
  3363. +<BR><BR>
  3364. +<DT><CODE>L</CODE>
  3365. +<DD>An integer in the range -8 to -1 is allowed. This is a Motorola-specific constraint.
  3366. +<BR><BR>
  3367. +<DT><CODE>M</CODE>
  3368. +<DD>A signed number whose magnitude is greater than 0x100 is allowed. This is a Motorola-specific constraint.
  3369. +<BR><BR>
  3370. +<DT><CODE>s</CODE>
  3371. +<DD>An immediate integer operand whose value is not an explicit integer is
  3372. +allowed.
  3373. +<BR><BR>
  3374. +This might appear strange; if an instruction allows a constant operand with a
  3375. +value not known at compile time, it certainly must allow any known
  3376. +value. So why use <CODE>s</CODE> instead of <CODE>i</CODE>? Sometimes it allows
  3377. +better code to be generated.
  3378. +For example, on the 68000 in a fullword instruction it is possible to
  3379. +use an immediate operand; but if the immediate value is between -128
  3380. +and 127, better code results from loading the value into a register and
  3381. +using the register. This is because the load into the register can be
  3382. +done with a <CODE>'moveq'</CODE> instruction. The GNU team arranges for this to happen
  3383. +by defining the letter <CODE>K</CODE> to mean "any integer outside the
  3384. +range -128 to 127", and then specifying <CODE>Ks</CODE> in the operand
  3385. +constraints. (This constraint is very unlikely to be useful for inline assembly,
  3386. +since you cannot use constraints to make GCC choose between 2 different
  3387. +inline assembly statements.)
  3388. +<BR><BR>
  3389. +<DT><CODE>g</CODE>
  3390. +<DD>Any register, memory or immediate integer operand is allowed, except for
  3391. +registers that are not general registers.
  3392. +<BR><BR>
  3393. +<DT><CODE>X</CODE>
  3394. +<DD>Any operand whatsoever is allowed, even if it does not satisfy
  3395. +<CODE>general_operand</CODE>. This is normally used in the constraint of
  3396. +a <CODE>match_scratch</CODE> when certain alternatives will not actually
  3397. +require a scratch register.
  3398. +<BR><BR>
  3399. +<DT><CODE>0</CODE>, <CODE>1</CODE>, <CODE>2</CODE>, ... <CODE>9</CODE>
  3400. +<DD>An operand that matches the specified operand number is allowed. If a
  3401. +digit is used together with letters within the same alternative, the
  3402. +digit should come last.
  3403. +This is called a <B>matching constraint</B> and what it really means is
  3404. +that the assembler has only a single operand that fills two roles
  3405. +considered separate. More precisely, the two operands that match must
  3406. +include one input-only operand and one output-only operand. Moreover, the digit
  3407. +must be a smaller number than the number of the operand that uses it in the
  3408. +constraint.
  3409. +<BR><BR>
  3410. +<DT><CODE>p</CODE>
  3411. +<DD>An operand that is a valid memory address is allowed.
  3412. +</DL>
  3413. +In order to have valid assembler code, each operand must satisfy
  3414. +its constraint. But a failure to do so does not prevent the pattern
  3415. +from applying to an instruction pattern. Instead, it directs the compiler to modify
  3416. +the code so that the constraint will be satisfied. Usually this is
  3417. +done by copying an operand into a register.
  3418. diff -Nur gnuexts/SEC96.hss fix/gnuexts/SEC96.hss
  3419. --- gnuexts/SEC96.hss 2003-09-16 16:47:38.000000000 +0200
  3420. +++ fix/gnuexts/SEC96.hss 2003-09-16 22:56:10.000000000 +0200
  3421. @@ -9,7 +9,7 @@
  3422. </PRE>
  3423. This specifies that the name to be used for the variable <CODE>foo</CODE> in
  3424. the assembler code should be <CODE>myfoo</CODE> rather than the usual
  3425. -<CODE>_foo</CODE>.
  3426. +<CODE>foo</CODE>.
  3427. <BR><BR>
  3428. On systems where an underscore is normally prepended to the name of a C
  3429. function or variable, this feature allows you to define names for the
  3430. @@ -23,12 +23,11 @@
  3431. future.
  3432. <BR><BR>
  3433. You cannot use <CODE>asm</CODE> in this way in a function <I>definition</I>; but
  3434. -you can get the same effect by writing a declaration for the function
  3435. +you can get the same effect by writing a <I>declaration</I> for the function
  3436. before its definition and putting <CODE>asm</CODE> there, like this:
  3437. <PRE>extern func () asm (&quot;FUNC&quot;);
  3438. -func (x, y)
  3439. - int x, y;
  3440. +func (int x, int y)
  3441. /* ... */
  3442. </PRE>
  3443. It is up to you to make sure that the assembler names you choose do not
  3444. diff -Nur gnuexts/SEC97.hss fix/gnuexts/SEC97.hss
  3445. --- gnuexts/SEC97.hss 2003-09-16 16:47:38.000000000 +0200
  3446. +++ fix/gnuexts/SEC97.hss 2003-09-16 22:56:10.000000000 +0200
  3447. @@ -1,30 +1,9 @@
  3448. [Main]
  3449. Title=Variables in Specified Registers
  3450. +Subsections=SEC98, SEC99, SEC99a
  3451. [Top]
  3452. GNU C allows you to put a few global variables into specified hardware
  3453. registers. You can also specify the register in which an ordinary
  3454. -register variable should be allocated.
  3455. -<UL>
  3456. -<LI>
  3457. -Global register variables reserve registers throughout the program.
  3458. -This may be useful in programs such as programming language
  3459. -interpreters which have a couple of global variables that are accessed
  3460. -very often.
  3461. -<BR><BR>
  3462. -</LI>
  3463. -<LI>
  3464. -Local register variables in specific registers do not reserve the
  3465. -registers. The compiler's data flow analysis is capable of determining
  3466. -where the specified registers contain live values, and where they are
  3467. -available for other uses. Stores into local register variables may be deleted
  3468. -when they appear to be dead according to dataflow analysis. References
  3469. -to local register variables may be deleted or moved or simplified.
  3470. -<BR><BR>
  3471. -These local variables are sometimes convenient for use with the extended
  3472. -<CODE>asm</CODE> feature (see <A HREF="$$INFOLINK(Extended Asm)">Extended Asm</A>), if you want to write one
  3473. -output of the assembler instruction directly into a particular register.
  3474. -(This will work provided the register you specify fits the constraints
  3475. -specified for that operand in the <CODE>asm</CODE>.)
  3476. -</LI>
  3477. -</UL>
  3478. +register variable should be allocated. TIGCC also allows you to specify
  3479. +an explicit register for function parameters.
  3480. \ No newline at end of file
  3481. diff -Nur gnuexts/SEC98.hss fix/gnuexts/SEC98.hss
  3482. --- gnuexts/SEC98.hss 2003-09-16 16:47:40.000000000 +0200
  3483. +++ fix/gnuexts/SEC98.hss 2003-09-17 01:07:40.000000000 +0200
  3484. @@ -1,23 +1,29 @@
  3485. [Main]
  3486. Title=Defining Global Register Variables
  3487. +[Description]
  3488. +Global register variables reserve registers throughout the program.
  3489. +This may be useful in programs such as programming language
  3490. +interpreters which have a couple of global variables that are accessed
  3491. +very often.
  3492. +
  3493. [Top]
  3494. You can define a global register variable in GNU C like this:
  3495. -<PRE>register int *foo asm (&quot;a5&quot;);
  3496. +<PRE>register int *foo asm (&quot;a3&quot;);
  3497. </PRE>
  3498. -Here <CODE>a5</CODE> is the name of the register which should be used. Choose a
  3499. +Here <CODE>a3</CODE> is the name of the register which should be used. Choose a
  3500. register which is normally saved and restored by function calls on your
  3501. machine, so that library routines will not clobber it.
  3502. <BR><BR>
  3503. Naturally the register name is cpu-dependent, so you would need to
  3504. conditionalize your program according to cpu type. The register
  3505. -<CODE>a5</CODE> would be a good choice on a 68000 for a variable of pointer
  3506. +<CODE>a3</CODE> would be a good choice on a 68000 for a variable of pointer
  3507. type. On machines with register windows, be sure to choose a &quot;global&quot;
  3508. register that is not affected magically by the function call mechanism.
  3509. <BR><BR>
  3510. In addition, operating systems on one type of cpu may differ in how they
  3511. name the registers; then you would need additional conditionals. For
  3512. -example, some 68000 operating systems call this register <CODE>%a5</CODE>.
  3513. +example, some 68000 operating systems call this register <CODE>%a3</CODE>.
  3514. <BR><BR>
  3515. Eventually there may be a way of asking the compiler to choose a register
  3516. automatically, but first we need to figure out how it should choose and
  3517. @@ -31,8 +37,8 @@
  3518. would appear to be dead, but references may be deleted or moved or
  3519. simplified.
  3520. <BR><BR>
  3521. -It is not safe to access the global register variables from signal
  3522. -handlers, or from more than one thread of control, because the system
  3523. +It is not safe to access the global register variables from interrupt
  3524. +handlers, because the system
  3525. library routines may temporarily use the register for other things (unless
  3526. you recompile them specially for the task at hand).
  3527. <BR><BR>
  3528. @@ -42,9 +48,9 @@
  3529. different source file in which the variable wasn't declared). This is
  3530. because <CODE>lose</CODE> might save the register and put some other value there.
  3531. For example, you can't expect a global register variable to be available in
  3532. -the comparison-function that you pass to <CODE>qsort</CODE>, since <CODE>qsort</CODE>
  3533. +the comparison-function that you pass to <A HREF="$$LINK(stdlib.h/qsort)">qsort</A>, since it
  3534. might have put something else in that register. (If you are prepared to
  3535. -recompile <CODE>qsort</CODE> with the same global register variable, you can
  3536. +recompile it with the same global register variable, you can
  3537. solve this problem.)
  3538. <BR><BR>
  3539. If you want to recompile <CODE>qsort</CODE> or other source files which do not
  3540. @@ -60,13 +66,10 @@
  3541. program that uses the global register variable must explicitly save and
  3542. restore the value which belongs to its caller.
  3543. <BR><BR>
  3544. -On most machines, <CODE>longjmp</CODE> will restore to each global register
  3545. -variable the value it had at the time of the <CODE>setjmp</CODE>. On some
  3546. -machines, however, <CODE>longjmp</CODE> will not change the value of global
  3547. -register variables. To be portable, the function that called <CODE>setjmp</CODE>
  3548. -should make other arrangements to save the values of the global register
  3549. -variables, and to restore them in a <CODE>longjmp</CODE>. This way, the same
  3550. -thing will happen regardless of what <CODE>longjmp</CODE> does.
  3551. +Be careful if you use <A HREF="$$LINK(setjmp.h/longjmp)">longjmp</A> with global register
  3552. +variables, because it will restore to each global register
  3553. +variable the value it had at the time of the
  3554. +<A HREF="$$LINK(setjmp.h/setjmp)">setjmp</A>.
  3555. <BR><BR>
  3556. All global register variable declarations must precede all function
  3557. definitions. If such a declaration could appear after function
  3558. @@ -76,10 +79,8 @@
  3559. Global register variables may not have initial values, because an
  3560. executable file has no means to supply initial contents for a register.
  3561. <BR><BR>
  3562. -On the SPARC, there are reports that g3 ... g7 are suitable
  3563. -registers, but certain library functions, such as <CODE>getwd</CODE>, as well
  3564. -as the subroutines for division and remainder, modify g3 and g4. g1 and
  3565. -g2 are local temporaries.
  3566. -<BR><BR>
  3567. -On the 68000, a2 ... a5 should be suitable, as should d2 ... d7.
  3568. +On the Motorola 68000, <CODE>a2</CODE>&nbsp;...&nbsp;<CODE>a5</CODE> should be suitable for global register variables,
  3569. +as should <CODE>d3</CODE>&nbsp;...&nbsp;<CODE>d7</CODE>.
  3570. Of course, it will not do to use more than a few of those.
  3571. +Note that <CODE>a5</CODE> is used by
  3572. +<CODE><A HREF="$$INFOLINK(httigcc/advanced_optrom)">OPTIMIZE_ROM_CALLS</A></CODE>.
  3573. diff -Nur gnuexts/SEC99.hss fix/gnuexts/SEC99.hss
  3574. --- gnuexts/SEC99.hss 2003-09-16 16:47:40.000000000 +0200
  3575. +++ fix/gnuexts/SEC99.hss 2003-09-16 22:56:10.000000000 +0200
  3576. @@ -1,7 +1,22 @@
  3577. [Main]
  3578. Title=Specifying Registers for Local Variables
  3579. +[Description]
  3580. +Local register variables in specific registers do not reserve the
  3581. +registers. The compiler's data flow analysis is capable of determining
  3582. +where the specified registers contain live values, and where they are
  3583. +available for other uses. Stores into local register variables may be deleted
  3584. +when they appear to be dead according to dataflow analysis. References
  3585. +to local register variables may be deleted or moved or simplified.
  3586. +
  3587. [Top]
  3588. +These local variables are sometimes convenient for use with the extended
  3589. +<CODE>asm</CODE> feature (see the section <A HREF="$$LINK(SEC94)">Assembler
  3590. +Instructions with C Expression Operands</A>), if you want to write one
  3591. +output of the assembler instruction directly into a particular register
  3592. +(this will work provided the register you specify fits the constraints
  3593. +specified for that operand in the <CODE>asm</CODE> block).
  3594. +<BR><BR>
  3595. You can define a local register variable with a specified register
  3596. like this:
  3597. <PRE>register int *foo asm (&quot;a5&quot;);
  3598. @@ -12,9 +27,9 @@
  3599. <BR><BR>
  3600. Naturally the register name is cpu-dependent, but this is not a
  3601. problem, since specific registers are most often useful with explicit
  3602. -assembler instructions (see <A HREF="$$INFOLINK(Extended Asm)">Extended Asm</A>). Both of these things
  3603. -generally require that you conditionalize your program according to
  3604. -cpu type.
  3605. +assembler instructions (see the section <A HREF="$$LINK(SEC94)">Assembler Instructions with C
  3606. +Expression Operands</A>), which is CPU-specific as well, and since TIGCC
  3607. +only supports exactly one CPU (the Motorola 68000) anyway.
  3608. <BR><BR>
  3609. In addition, operating systems on one type of cpu may differ in how they
  3610. name the registers; then you would need additional conditionals. For
  3611. diff -Nur gnuexts/SEC99a.hss fix/gnuexts/SEC99a.hss
  3612. --- gnuexts/SEC99a.hss 1970-01-01 01:00:00.000000000 +0100
  3613. +++ fix/gnuexts/SEC99a.hss 2003-09-16 22:56:10.000000000 +0200
  3614. @@ -0,0 +1,37 @@
  3615. +[Main]
  3616. +Title=Specifying Registers for Function Parameters
  3617. +See Also=SEC85_regparm: regparm
  3618. +
  3619. +[Description]
  3620. +In TIGCC, it is possible to specify explictly where the parameters to a function
  3621. +a stored, in a syntax similar to global and local register variables.
  3622. +
  3623. +[Top]
  3624. +TIGCC can pass function parameters either on the stack or through registers.
  3625. +You can use the <CODE><A HREF="$$LINK(SEC85_regparm)">regparm</A></CODE> attribute or the <B>'-mregparm'</B>
  3626. +compiler switch to let the compiler automatically choose registers for the parameters, but you can
  3627. +also tell TIGCC to put a parameter into a specific register. This can be very handy when
  3628. +interfacing with assembly code. For example, the following assembly function expects its 2
  3629. +parameters in the <CODE>d1</CODE> and <CODE>d2</CODE> registers:
  3630. +<PRE>asm(".globl add
  3631. +add:
  3632. + move.l %d2,%d0
  3633. + add.l %d1,%d0
  3634. + rts");
  3635. +</PRE>
  3636. +Therefore, its prototype would be:
  3637. +<PRE>unsigned long add (unsigned long a asm("d1"), unsigned long b asm("d2"));
  3638. +</PRE>
  3639. +Explicit register specifications for function parameters are also supported in function headers
  3640. +(not only in prototypes). Therefore, the assembly function above could be replaced by the following
  3641. +C equivalent:
  3642. +<PRE>unsigned long add (unsigned long a asm("d1"), unsigned long b asm("d2"))
  3643. +{
  3644. + return a + b;
  3645. +}
  3646. +</PRE>
  3647. +to pass a register parameter. The registers do not necessarily need to be
  3648. +call-clobbered. You can also use a2-a5/d3-d7 to pass a register parameter.
  3649. +But note that the called function still has to save and restore those registers,
  3650. +even if they are used as arguments! In C code, TIGCC takes care of that
  3651. +automatically for you, but in assembly code, it is something you need to remember.
  3652. diff -Nur gnuexts/gnuexts.hss fix/gnuexts/gnuexts.hss
  3653. --- gnuexts/gnuexts.hss 2003-09-16 16:47:24.000000000 +0200
  3654. +++ fix/gnuexts/gnuexts.hss 2003-09-17 01:21:12.000000000 +0200
  3655. @@ -1,16 +1,42 @@
  3656. [Main]
  3657. -Title=Extensions to the C Language Family
  3658. +Title=GNU C Language Extensions
  3659. +Subsections=SEC63, SEC64, SEC65, SEC66, SEC67, SEC69, SEC70, SEC71, SEC72, SEC73, SEC74, SEC110, SEC111, SEC75, SEC76, SEC77, SEC78, SEC79, SEC80, SEC81, SEC82, SEC84, SEC83, SEC85, SEC91, SEC92, SEC85a, SEC86, SEC87, SEC88, SEC89, SEC90, SEC93, SEC94_asm, SEC96, SEC97, SEC100, SEC101, SEC102, SEC103, SEC104, SEC105, SEC106, SEC107, SEC108, SEC109, history, gnugpl/gnugpl, gnugpl/gnufdl, gnugpl/funding
  3660. [Top]
  3661. -GNU C provides several language features not found in ISO standard C.
  3662. -(The <B>'-pedantic'</B> option directs GCC to print a warning message if
  3663. -any of these features is used.) To test for the availability of these
  3664. +This part of the documentation is a modified version of the <A HREF="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html">C Extensions</A> section of the <A HREF="http://gcc.gnu.org/onlinedocs/gcc/">GCC Manual</A>.
  3665. +Therefore it is licensed under the <A HREF="$$INFOLINK(gnugpl/gnufdl)">GNU Free Documentation License</A>.
  3666. +<BR><BR>
  3667. +TIGCC (like all GNU C compilers) provides several language features not found
  3668. +in ISO standard C. To test for the availability of these
  3669. features in conditional compilation, check for a predefined macro
  3670. -<CODE>__GNUC__</CODE>, which is always defined under GCC.
  3671. +<CODE><A HREF="$$INFOLINK(cpp/SEC15_GNUC)">__GNUC__</A></CODE>, which is always defined under GCC.
  3672. +<BR><BR>
  3673. +Some features that are in ISO C99 but not C89 are also, as
  3674. +extensions, accepted by GCC in C89 mode.
  3675. +
  3676. +[Bottom]
  3677. +Original author: Free Software Foundation, Inc.
  3678. +<BR>
  3679. +Authors of the modifications: Zeljko Juric, Sebastian Reichelt, and Kevin Kofler
  3680. +<BR>
  3681. +Published by the TIGCC Team.
  3682. +<BR>
  3683. +See the <A HREF="$$LINK(history)">History</A> section for details and copyright information.
  3684. +<BR><BR>
  3685. +Permission is granted to copy, distribute and/or modify this document
  3686. +under the terms of the <A HREF="$$INFOLINK(gnugpl/gnufdl)">GNU Free Documentation License</A>, Version 1.1 or any
  3687. +later version published by the Free Software Foundation; with the Invariant
  3688. +Sections being "<A HREF="$$INFOLINK(gnugpl)">GNU General Public License</A>" and "<A HREF="$$INFOLINK(gnugpl/funding)">Funding Free Software</A>", the
  3689. +Front-Cover texts being (a) (see below), and with the Back-Cover Texts being
  3690. +(b) (see below). A copy of the license is included in the section entitled
  3691. +"<A HREF="$$INFOLINK(gnugpl/gnufdl)">GNU Free Documentation License</A>".
  3692. +<BR><BR>
  3693. +(a) The FSF's Front-Cover Text is:
  3694. +<BR><BR>
  3695. +A GNU Manual
  3696. <BR><BR>
  3697. -These extensions are available in C and Objective-C. Most of them are
  3698. -also available in C++. See <A HREF="$$INFOLINK(C++ Extensions,,Extensions to the C++ Language)">Extensions to the
  3699. -C++ Language</A> for extensions that apply <I>only</I> to C++.
  3700. +(b) The FSF's Back-Cover Text is:
  3701. <BR><BR>
  3702. -Some features that are in ISO C99 but not C89 or C++ are also, as
  3703. -extensions, accepted by GCC in C89 mode and in C++.
  3704. +You have freedom to copy and modify this GNU Manual, like GNU software.
  3705. +Copies published by the Free Software Foundation raise funds for GNU
  3706. +development.
  3707. diff -Nur gnuexts/history.hss fix/gnuexts/history.hss
  3708. --- gnuexts/history.hss 1970-01-01 01:00:00.000000000 +0100
  3709. +++ fix/gnuexts/history.hss 2003-09-16 22:56:10.000000000 +0200
  3710. @@ -0,0 +1,24 @@
  3711. +[Main]
  3712. +Title=History
  3713. +
  3714. +[Top]
  3715. +<UL>
  3716. +<LI><B>Original Version:</B> <A HREF="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html">Extensions to the C Language Family</A>
  3717. +<BR><BR>
  3718. +Published by the Free Software Foundation
  3719. +<BR>
  3720. +59 Temple Place - Suite 330
  3721. +<BR>
  3722. +Boston, MA 02111-1307 USA
  3723. +<BR><BR>
  3724. +Copyright &copy; 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
  3725. +2000, 2001, 2002 Free Software Foundation, Inc.
  3726. +<BR><BR>
  3727. +</LI>
  3728. +<LI><B>Modifications for TIGCC:</B> <A HREF="$$LINK(gnuexts)">GNU C Language Extensions</A>
  3729. +<BR><BR>
  3730. +Published by the TIGCC Team
  3731. +<BR><BR>
  3732. +Copyright &copy; 2000, 2001, 2002 Zeljko Juric, Sebastian Reichelt, Kevin Kofler
  3733. +</LI>
  3734. +</UL>