Knowledge

Inline function

Source ๐Ÿ“

1096:, oftentimes certain functions need to be placed in certain code sections by use of special compiler instructions such as "pragma" statements. Sometimes, a function in one memory segment might need to call a function in another memory segment, and if inlining of the called function occurs, then the code of the called function might end up in a segment where it shouldn't be. For example, high-performance memory segments may be very limited in code space, and if a function belonging in such a space calls another large function that is not meant to be in the high-performance section and the called function gets inappropriately inlined, then this might cause the high-performance memory segment to run out of code space. For this reason, sometimes it is necessary to ensure that functions do 39: 609:, then link against that library instead of the individual object files. That causes only those object files to be linked that are actually needed, in contrast to linking the object files directly, which causes them to be always included in the executable. However, the library file must be specified after all the other object files on the linker command line, since calls from object files specified after the library file to the functions will not be considered by the linker. Calls from 660:
in header files. Then, no unreachable code will be generated. However, this approach has a drawback in the opposite case: Duplicate code will be generated if the function could not be inlined in more than one translation unit. The emitted function code cannot be shared among translation units because
581:
qualifier and generate calls to the function instead, as typically happens if the code is compiled without optimization. (This may be the desired behavior, if the function is supposed to be inlined everywhere by all means, and an error should be generated if it is not.) A convenient way is to define
1088:
function in every module (translation unit) that uses it, whereas an ordinary function must be defined in only a single module. Otherwise it would not be possible to compile a single module independently of all other modules. Depending on the compiler, this may cause each respective object file to
1122:
specifier indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function call mechanism. An implementation is not required to perform this inline substitution at the point of call; however, even if this inline substitution
436:
Indiscriminate uses of that can result in larger code (bloated executable file), minimal or no performance gain, and in some cases even a loss in performance. Moreover, the compiler cannot inline the function in all circumstances, even when inlining is forced; in this case both gcc and Visual C++
1076:
in C99 requires exactly one external definition of the function, if it is used somewhere. If such a definition wasn't provided by the programmer, that can easily lead to linker errors. This can happen with optimization turned off, which typically prevents inlining. Adding the definitions, on the
576:
or without qualifier. If more than one such definition is provided in the whole program, the linker will complain about duplicate symbols. If, however, it is lacking, the linker does not necessarily complain, because, if all uses could be inlined, it is not needed. But it may complain, since the
1065:
As functions evolve, they may become suitable for inlining where they were not before, or no longer suitable for inlining where they were before. While inlining or un-inlining a function is easier than converting to and from macros, it still requires extra maintenance which typically yields
640:
functions. (It may be desired to link functions into the executable that are to be called by the programmer from the debugger rather than by the program itself, eg., for examining the internal state of the program.) With this approach, it is also possible to use a single .c file with all
1157:. An inline definition provides an alternative to an external definition, which a translator may use to implement any call to the function in the same translation unit. It is unspecified whether a call to the function uses the inline definition or the external definition. 809:. The rationale for the C++ approach is that it is the most convenient way for the programmer, since no special precautions for elimination of unreachable code must be taken and, like for ordinary functions, it makes no difference whether 796:
will, if required, emit a function shared among translation units, typically by putting it into the common section of the object file for which it is needed. The function must have the same definition everywhere, always with the
125:
is to change linkage behavior; the details of this are complicated. This is necessary due to the C/C++ separate compilation + linkage model, specifically because the definition (body) of the function must be duplicated in all
363:
does not force inlining; the compiler is free to choose not to inline the function at all, or only in some cases. Different compilers vary in how complex a function they can manage to inline. Mainstream C++ compilers like
732:
The remarks for C99 about the need to provide exactly one externally visible function instance for inlined functions and about the resulting problem with unreachable code apply mutatis mutandis to gnu89 as well.
1055:
Often, a compiler is in a better position than a human to decide whether a particular function should be inlined. Sometimes the compiler may not be able to inline as many functions as the programmer indicates.
1069:
Inline functions used in proliferation in native C-based compilation systems can increase compilation time, since the intermediate representation of their bodies is copied into each call site.
542:
will always, emit an externally visible function. Unlike in C++, there is no way to ask for an externally visible function shared among translation units to be emitted only if required.
380:
keyword to let the compiler make all inlining decisions is not possible, since the linker will then complain about duplicate definitions in different translation units. This is because
384:
not only gives the compiler a hint that the function should be inlined, it also has an effect on whether the compiler will generate a callable out-of-line copy of the function (see
1142:... Making a function an inline function suggests that calls to the function be as fast as possible. The extent to which such suggestions are effective is implementation-defined ( 1021:
The program takes the address of the function and the call is made via the pointer to the function. Direct calls to functions that have had their address taken can be inlined.
1144:
footnote: For example, an implementation might never perform inline substitution, or might only perform inline substitutions to calls in the scope of an inline declaration.
886:
local variables may or may not be different objects in different translation units, depending on whether the function was inlined or whether a call was made. Only
669:
functions should only be used if they are used in only one translation unit, which means that they should only go to the respective .c file, not to a header file.
111:, i.e. by inserting the function code at the address of each function call, thereby saving the overhead of a function call. In this respect it is analogous to the 1077:
other hand, can cause unreachable code if the programmer does not carefully avoid it, by putting them in a library for linking, using link time optimization, or
410:
Some implementations provide a means by which to force the compiler to inline a function, usually by means of implementation-specific declaration specifiers:
717:
will never emit an externally visible function. The rationale for this is that it matches variables, for which storage will never be reserved if defined as
590:
declaration for it and including the respective header file with the definition. It does not matter whether the declaration is before or after the include.
597:
from being added to the final executable if all uses of a function were inlined, it is advised to put the object files of all such .c files with a single
890:
definitions can reference identifiers with internal linkage without restrictions; those will be different objects in each translation unit. In C++, both
836:
semantics that are the same as in C++: Such definitions will emit a function shared among translation units if required. In C99 mode,
729:
would have a side-effect—to always emit a non-inlined version of the function—that is contrary to what its name suggests.
1153:
An inline definition does not provide an external definition for the function, and does not forbid an external definition in another
649:. However, the gcc manual page warns about that, saying "Only use these options when there are significant benefits from doing so." 636:
function. However, it also removes any and all other unused sections from all other object files, not just those related to unused
142:(it violates uniqueness of external symbols). C and C++ (and dialects such as GNU C and Visual C++) resolve this in different ways. 632:
to omit sections in which all functions are unused. This will be the case for object files containing the code of a single unused
508:
has the same effects in all C dialects and C++. It will emit a locally visible (out-of-line copy of the) function if required.
1520: 1499: 1478: 1457: 1436: 1415: 1373: 1352: 840:
always emits a function, but like in C++, it will be shared among translation units. Thus, the same function can be defined
286:
may be translated into (if the compiler decides to do the inlining, which typically requires optimization to be enabled):
1394: 1007:. With the pragma, recursive functions are inlined to a default depth of 16 calls. To reduce the inlining depth, use 403:
as an extension to C89. However, the semantics differ from both those of C++ and C99. armcc in C90 mode also offers
744:
was explicitly specified. With version 5, gcc switched from gnu89 to the gnu11 dialect, effectively enabling C99
722: 1567: 1154: 372:
support an option that lets the compilers automatically inline any suitable function, even those not marked as
127: 89: 685:
are essentially the exact opposite of those in C99, with the exception that gnu89 permits redefinition of an
661:
it must have different addresses. This is another drawback; taking the address of such a function defined as
557:
qualifier or storage class), the translation unit must contain a definition (no matter whether unqualified,
1000: 844:
in different translation units. This matches the traditional behavior of Unix C compilers for multiple non-
1044: 1038: 748:
semantics by default. To use gnu89 semantics instead, they have to be enabled explicitly, either with
1315: 628:
An alternative solution is to use link time optimization instead of a library. gcc provides the flag
1547: 1218: 1173: 572:
requires exactly one function with that name somewhere else in the program which is either defined
74: 332:
When implementing a sorting algorithm doing lots of swaps, this can increase the execution speed.
1541: 369: 115: 1051:
functions as a language feature may not be as valuable as they appear, for a number of reasons:
1089:
contain a copy of the function's code, for each module with some use that could not be inlined.
986: 1426: 1342: 1197: 19:
This article is about inline functions in C and C++. For inline expansion more generally, see
1510: 1489: 1468: 1447: 1405: 1384: 1363: 1205: 1301: 1256: 1123:
is omitted, the other rules for inline functions defined by 7.1.2 shall still be respected.
81: 860:
function requires code for a non-inlined copy of that function to be emitted in any case.
8: 665:
in a header file will yield different values in different translation units. Therefore,
56:
Please help update this article to reflect recent events or newly available information.
979: 975:
The function or its caller is compiled with /Ob0 (the default option for debug builds).
721:
and always if defined without. The rationale for C99, in contrast, is that it would be
365: 135: 100: 967:
Based on Microsoft Specifications at MSDN, MS Visual C++ cannot inline (not even with
820:
qualifier is automatically added to a function defined as part of a class definition.
1516: 1495: 1474: 1453: 1432: 1411: 1390: 1369: 1348: 1093: 909: 645:
functions instead of one .c file per function. Then the file has to be compiled with
428:, the latter of which is useful to avoid a conflict with a user-defined macro named 51: 1015: 594: 108: 27: 20: 1235: 1537: 993: 936: 352: 901:
locals are allowed and they refer to the same object in all translation units.
652:
Some recommend an entirely different approach, which is to define functions as
602: 1561: 586:
functions in header files and create one .c file per function, containing an
1509:
DEHURI, SATCHIDANANDA; JAGADEV, ALOK KUMAR; RATH, AMIYA KUMAR (8 May 2007).
1287: 982:(C++ exception handling in one, structured exception handling in the other). 447:
is not respected by the compiler (ignored by compiler cost/benefit analyzer)
1018:
and is called virtually. Direct calls to virtual functions can be inlined.
407:
as a non-standard extension, with semantics different from gnu89 and C99.
454:
For code portability, the following preprocessor directives may be used:
1386:
Object-oriented Programming: Using C++ for Engineering and Technology
1270: 348: 104: 515:
qualifier and generate a function call in all C dialects and C++.
917: 399:, as part of the dialect gnu89 that it offers, has support for 565:) and an externally visible function will be emitted for it. 511:
Regardless of the storage class, the compiler can ignore the
477:#define forceinline inline __attribute__((__always_inline__)) 468:#define forceinline inline __attribute__((__always_inline__)) 396: 340: 78: 1062:
function) gets exposed to its client (the calling function).
617:
functions will be resolved by the linker automatically (the
553:
declarations or with unqualified declarations (ie., without
1551: 1128:
ISO/IEC 14882:2011, the current C++ standard, section 7.1.2
1043:
Besides the problems with inline expansion in general (see
359:
functions, though with different semantics. In both cases,
1365:
Object-Oriented Programming: Fundamentals And Applications
344: 107:
substitute the body of the function inline by performing
50:. The reason given is: Meaning of inline changed in C++ ( 385: 500: 450:
inlining results is necessary for boosting performance
1271:"Josef "Jeff" Sipek ยป GNU inline vs. C99 inline" 1058:
An important point to note is that the code (of the
1230: 1228: 978:The function and the caller use different types of 526:functions differs between the C dialects and C++. 1508: 1257:"Using the GNU Compiler Collection (GCC): Inline" 1162:ISO 9899:1999(E), the C99 standard, section 6.7.4 52:https://en.cppreference.com/w/cpp/language/inline 1559: 1424: 1225: 118:, which similarly provides an optimization hint. 1282: 1280: 848:definitions of uninitialized global variables. 736:gcc up to and including version 4.2 used gnu89 709:; in other words, in gnu89, a function defined 689:function as an unqualified function, while C99 155:function can be written in C or C++ like this: 16:Function in the C and C++ programming languages 764:declarations. To ensure C99 semantics, either 103:that suggests (but does not require) that the 1045:Inline expansion ยง Effect on performance 1039:Inline expansion ยง Effect on performance 996:, unless compiled with /Og, /Ox, /O1, or /O2. 1403: 1344:C++ AND OBJECT-ORIENTED PROGRAMMING PARADIGM 1277: 1251: 1249: 1247: 1245: 1191: 1189: 1449:Creating Games in C++: A Step-by-step Guide 1302:"Ian Lance Taylor - Clean up extern inline" 1118:specifier declares an inline function. The 1024:The function is also marked with the naked 130:where it is used, to allow inlining during 1548:Summary of "inline" semantics in C and C++ 1242: 1186: 391: 255:Then, a statement such as the following: 1425:Kirch-Prinz, Ulla; Prinz, Peter (2002). 1361: 1138:function specifier is an inline function 376:functions. However, simply omitting the 1466: 1560: 1445: 1428:A Complete Guide to Programming in C++ 1195: 474:#if __has_attribute(__always_inline__) 134:, which, if the function has external 1512:OBJECT-ORIENTED PROGRAMMING USING C++ 1382: 1084:In C++, it is necessary to define an 1487: 1407:Object Oriented Programming with C++ 1340: 32: 713:will always and a function defined 647:-fdata-sections -ffunction-sections 538:will never, and a function defined 501:Storage classes of inline functions 386:storage classes of inline functions 335: 13: 1362:Sengupta, Probal (1 August 2004). 426:__attribute__((__always_inline__)) 14: 1579: 1531: 1431:. Jones & Bartlett Learning. 1341:JANA, DEBASISH (1 January 2005). 697:without redefinition is like C99 462:#define forceinline __forceinline 1328:gcc manual page, description of 1288:"Porting to GCC 5 - GNU Project" 518:The effect of the storage class 37: 1316:"Documentation โ€“ Arm Developer" 904:gcc cannot inline functions if 875:global variables or define non- 851: 577:compiler can always ignore the 522:when applied or not applied to 440:Forcing inlining is useful if: 1410:. Tata McGraw-Hill Education. 1322: 1308: 1294: 1263: 1196:Meyers, Randy (July 1, 2002). 422:__attribute__((always_inline)) 1: 1198:"The New C: Inline Functions" 1179: 752:or, to only affect inlining, 1134:A function declared with an 1005:#pragma inline_recursion(on) 549:declarations are mixed with 138:, causes a collision during 95:; this serves two purposes: 7: 1167: 1032: 828:armcc in C90 mode provides 792:In C++, a function defined 534:In C99, a function defined 347:, but not its predecessors 10: 1584: 1554:contributor David Chisnall 1066:relatively little benefit. 1036: 492:#define forceinline inline 483:#define forceinline inline 146: 88:is one qualified with the 25: 18: 1515:. PHI Learning Pvt. Ltd. 1488:Love (1 September 2005). 1368:. PHI Learning Pvt. Ltd. 1347:. PHI Learning Pvt. Ltd. 1104: 871:function must not access 856:Taking the address of an 46:This article needs to be 1491:Linux Kernel Development 1174:Macro (computer science) 823: 672: 471:#elif defined(__CLANG__) 456: 288: 257: 157: 26:Not to be confused with 1542:GNU Compiler Collection 1467:Skinner, M. T. (1992). 1236:"Inline Functions in C" 1003:and not accompanied by 465:#elif defined(__GNUC__) 116:storage class specifier 1446:Conger, David (2006). 1213:Cite journal requires 1165: 1131: 1110:A function declaration 987:variable argument list 787: 693:does not. Thus, gnu89 529: 414:Microsoft Visual C++: 392:Nonstandard extensions 121:The second purpose of 1568:Software optimization 1494:. Pearson Education. 1470:The Advanced C++ Book 1404:Balagurusamy (2013). 1383:Svenk, Goran (2003). 1132: 1108: 1072:The specification of 813:is specified or not. 605:file, typically with 82:programming languages 1389:. Cengage Learning. 962:__builtin_apply_args 740:semantics even when 366:Microsoft Visual C++ 985:The function has a 801:qualifier. In C++, 756:, or by adding the 677:gnu89 semantics of 613:functions to other 568:A function defined 437:generate warnings. 355:, have support for 992:The function uses 980:exception handling 101:compiler directive 1522:978-81-203-3085-6 1501:978-81-7758-910-8 1480:978-0-929306-10-0 1473:. Silicon Press. 1459:978-0-7357-1434-2 1438:978-0-7637-1817-6 1417:978-1-259-02993-6 1375:978-81-203-1258-6 1354:978-81-203-2871-6 1094:embedded software 949:__builtin_longjmp 882:local variables. 760:attribute to all 630:-Wl,--gc-sections 128:translation units 71: 70: 1575: 1538:Inline functions 1526: 1505: 1484: 1463: 1442: 1421: 1400: 1379: 1358: 1332: 1331: 1326: 1320: 1319: 1312: 1306: 1305: 1298: 1292: 1291: 1284: 1275: 1274: 1267: 1261: 1260: 1253: 1240: 1239: 1232: 1223: 1222: 1216: 1211: 1209: 1201: 1193: 1163: 1155:translation unit 1152: 1141: 1129: 1113: 1087: 1080: 1075: 1061: 1050: 1027: 1014:The function is 1010: 1006: 999:The function is 970: 963: 956: 955:__builtin_return 950: 944: 937:nested functions 932: 926: 920: 900: 897: 893: 889: 885: 881: 878: 874: 870: 866: 859: 847: 843: 839: 835: 831: 819: 812: 808: 804: 800: 795: 783: 779: 775: 771: 767: 763: 759: 755: 751: 747: 743: 739: 728: 720: 716: 712: 708: 704: 700: 696: 692: 688: 684: 680: 668: 664: 659: 655: 648: 644: 639: 635: 631: 624: 620: 616: 612: 608: 601:function into a 600: 595:unreachable code 589: 585: 580: 575: 571: 564: 560: 556: 552: 548: 541: 537: 525: 521: 514: 507: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 446: 431: 427: 423: 417: 406: 402: 383: 379: 375: 362: 358: 336:Standard support 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 282: 279: 276: 273: 270: 267: 264: 261: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 164: 161: 154: 124: 114: 109:inline expansion 94: 66: 63: 57: 41: 40: 33: 28:Inline assembler 21:Inline expansion 1583: 1582: 1578: 1577: 1576: 1574: 1573: 1572: 1558: 1557: 1534: 1529: 1523: 1502: 1481: 1460: 1439: 1418: 1397: 1376: 1355: 1336: 1335: 1329: 1327: 1323: 1314: 1313: 1309: 1300: 1299: 1295: 1286: 1285: 1278: 1269: 1268: 1264: 1255: 1254: 1243: 1234: 1233: 1226: 1214: 1212: 1203: 1202: 1194: 1187: 1182: 1170: 1164: 1161: 1150: 1139: 1130: 1127: 1111: 1107: 1100:become inlined. 1085: 1078: 1073: 1059: 1048: 1041: 1035: 1025: 1008: 1004: 994:inline assembly 968: 961: 954: 948: 942: 930: 924: 916: 898: 895: 891: 887: 883: 879: 876: 872: 868: 864: 857: 854: 845: 841: 837: 833: 829: 826: 817: 810: 806: 805:is the same as 802: 798: 793: 790: 784:) can be used. 781: 777: 773: 769: 765: 761: 757: 753: 749: 745: 741: 737: 726: 718: 714: 710: 706: 702: 698: 694: 690: 686: 682: 678: 675: 666: 662: 657: 653: 646: 642: 637: 633: 629: 625:ensures this). 622: 618: 614: 610: 606: 598: 587: 583: 578: 573: 569: 562: 558: 554: 550: 546: 539: 535: 532: 523: 519: 512: 505: 503: 498: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 459:#ifdef _MSC_VER 458: 444: 429: 425: 421: 415: 404: 400: 394: 381: 377: 373: 360: 356: 338: 330: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 284: 283: 280: 277: 274: 271: 268: 265: 262: 259: 253: 252: 249: 246: 243: 240: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 165: 162: 159: 152: 149: 122: 112: 99:It serves as a 92: 86:inline function 67: 61: 58: 55: 42: 38: 31: 24: 17: 12: 11: 5: 1581: 1571: 1570: 1556: 1555: 1545: 1533: 1532:External links 1530: 1528: 1527: 1521: 1506: 1500: 1485: 1479: 1464: 1458: 1452:. New Riders. 1443: 1437: 1422: 1416: 1401: 1395: 1380: 1374: 1359: 1353: 1337: 1334: 1333: 1321: 1307: 1293: 1276: 1262: 1241: 1224: 1215:|journal= 1184: 1183: 1181: 1178: 1177: 1176: 1169: 1166: 1159: 1125: 1106: 1103: 1102: 1101: 1090: 1082: 1070: 1067: 1063: 1056: 1034: 1031: 1030: 1029: 1022: 1019: 1012: 997: 990: 983: 976: 965: 964: 958: 951: 945: 939: 933: 927: 921: 913: 853: 850: 825: 822: 789: 786: 782:-fgnu89-inline 754:-fgnu89-inline 674: 671: 603:static library 531: 528: 502: 499: 457: 452: 451: 448: 434: 433: 420:gcc or clang: 418: 393: 390: 337: 334: 289: 258: 158: 148: 145: 144: 143: 119: 69: 68: 45: 43: 36: 15: 9: 6: 4: 3: 2: 1580: 1569: 1566: 1565: 1563: 1553: 1549: 1546: 1543: 1539: 1536: 1535: 1524: 1518: 1514: 1513: 1507: 1503: 1497: 1493: 1492: 1486: 1482: 1476: 1472: 1471: 1465: 1461: 1455: 1451: 1450: 1444: 1440: 1434: 1430: 1429: 1423: 1419: 1413: 1409: 1408: 1402: 1398: 1396:0-7668-3894-3 1392: 1388: 1387: 1381: 1377: 1371: 1367: 1366: 1360: 1356: 1350: 1346: 1345: 1339: 1338: 1325: 1317: 1311: 1303: 1297: 1289: 1283: 1281: 1272: 1266: 1258: 1252: 1250: 1248: 1246: 1237: 1231: 1229: 1220: 1207: 1199: 1192: 1190: 1185: 1175: 1172: 1171: 1158: 1156: 1147: 1145: 1137: 1124: 1121: 1117: 1099: 1095: 1091: 1083: 1079:static inline 1071: 1068: 1064: 1057: 1054: 1053: 1052: 1046: 1040: 1023: 1020: 1017: 1013: 1002: 998: 995: 991: 988: 984: 981: 977: 974: 973: 972: 969:__forceinline 959: 952: 946: 940: 938: 934: 929:use nonlocal 928: 923:use computed 922: 919: 914: 911: 907: 906: 905: 902: 888:static inline 869:extern inline 861: 849: 842:extern inline 838:extern inline 830:extern inline 821: 814: 803:extern inline 785: 734: 730: 724: 715:extern inline 707:extern inline 695:extern inline 687:extern inline 683:extern inline 670: 667:static inline 663:static inline 654:static inline 650: 643:extern inline 638:extern inline 634:extern inline 626: 604: 599:extern inline 596: 591: 588:extern inline 574:extern inline 566: 563:extern inline 551:extern inline 543: 540:extern inline 527: 516: 509: 506:static inline 455: 449: 443: 442: 441: 438: 430:always_inline 419: 416:__forceinline 413: 412: 411: 408: 398: 389: 387: 371: 367: 354: 350: 346: 342: 333: 287: 256: 156: 141: 137: 133: 129: 120: 117: 110: 106: 102: 98: 97: 96: 91: 87: 83: 80: 76: 65: 53: 49: 44: 35: 34: 29: 22: 1511: 1490: 1469: 1448: 1427: 1406: 1385: 1364: 1343: 1324: 1310: 1296: 1265: 1206:cite journal 1148: 1143: 1135: 1133: 1119: 1115: 1114:... with an 1109: 1097: 1042: 1009:inline_depth 966: 903: 884:const static 862: 855: 852:Restrictions 827: 815: 791: 735: 731: 705:is like C99 701:, and gnu89 676: 651: 627: 592: 567: 544: 533: 517: 510: 504: 453: 439: 435: 409: 395: 339: 331: 285: 254: 150: 139: 131: 85: 72: 59: 47: 1330:-fno-common 863:In C99, an 723:astonishing 656:instead of 593:To prevent 1180:References 1037:See also: 1026:__declspec 778:-std=gnu11 774:-std=gnu99 758:gnu_inline 750:-std=gnu89 621:option in 62:April 2019 1540:with the 1028:modifier. 1001:recursive 908:they are 780:(without 725:if using 349:K&R C 132:compiling 1562:Category 1168:See also 1160:โ€”  1126:โ€”  1033:Problems 910:variadic 894:and non- 770:-std=c11 766:-std=c99 742:-std=c99 113:register 105:compiler 1016:virtual 1011:pragma. 147:Example 140:linking 136:linkage 90:keyword 73:In the 48:updated 1519:  1498:  1477:  1456:  1435:  1414:  1393:  1372:  1351:  1151:  1140:  1136:inline 1120:inline 1116:inline 1112:  1105:Quotes 1086:inline 1074:inline 1060:inline 1049:inline 971:), if 943:setjmp 918:alloca 899:static 880:static 873:static 865:inline 858:inline 846:extern 834:inline 818:inline 811:extern 807:inline 799:inline 794:inline 762:inline 746:inline 738:inline 727:inline 719:extern 711:inline 703:inline 699:inline 691:inline 679:inline 658:inline 623:ar rcs 615:inline 611:inline 607:ar rcs 584:inline 579:inline 570:inline 559:inline 555:inline 547:inline 536:inline 524:inline 520:extern 513:inline 495:#endif 486:#endif 445:inline 405:inline 401:inline 382:inline 378:inline 374:inline 361:inline 357:inline 160:inline 153:inline 123:inline 93:inline 1550:, by 1544:(GCC) 896:const 892:const 877:const 824:armcc 673:gnu89 561:, or 489:#else 480:#else 397:GNU C 275:& 266:& 84:, an 1552:LLVM 1517:ISBN 1496:ISBN 1475:ISBN 1454:ISBN 1433:ISBN 1412:ISBN 1391:ISBN 1370:ISBN 1349:ISBN 1219:help 960:use 957:, or 953:use 947:use 941:use 935:use 931:goto 925:goto 915:use 832:and 816:The 681:and 582:the 368:and 351:and 343:and 260:swap 166:swap 163:void 77:and 1149:... 1098:not 1092:In 1047:), 867:or 788:C++ 776:or 545:If 530:C99 424:or 388:). 370:GCC 353:C89 345:C99 341:C++ 324:tmp 294:tmp 291:int 244:tmp 202:tmp 199:int 184:int 172:int 151:An 79:C++ 1564:: 1279:^ 1244:^ 1227:^ 1210:: 1208:}} 1204:{{ 1188:^ 1146:) 772:, 768:, 281:); 54:). 1525:. 1504:. 1483:. 1462:. 1441:. 1420:. 1399:. 1378:. 1357:. 1318:. 1304:. 1290:. 1273:. 1259:. 1238:. 1221:) 1217:( 1200:. 1081:. 989:. 912:, 619:s 432:. 327:; 321:= 318:y 315:; 312:y 309:= 306:x 303:; 300:x 297:= 278:y 272:, 269:x 263:( 250:} 247:; 241:= 238:n 235:* 232:; 229:n 226:* 223:= 220:m 217:* 214:; 211:m 208:* 205:= 196:{ 193:) 190:n 187:* 181:, 178:m 175:* 169:( 75:C 64:) 60:( 30:. 23:.

Index

Inline expansion
Inline assembler
https://en.cppreference.com/w/cpp/language/inline
C
C++
programming languages
keyword
compiler directive
compiler
inline expansion
storage class specifier
translation units
linkage
C++
C99
K&R C
C89
Microsoft Visual C++
GCC
storage classes of inline functions
GNU C
unreachable code
static library
astonishing
variadic
alloca
nested functions
exception handling
variable argument list
inline assembly

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

โ†‘