æããã«åè ã®æ¹ãéãã ããã¨æã£ã¦ãããã³ã³ãã¤ã©ããªãã¦ããããã ã g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSEon model name : Intel(R) Xeon(R) CPU W3520 @ 2.67GHzã§ã次ã®ã³ã¼ãã試ãã¦ã¿ãã #include <iostream> #include <vector> #include <utility> #includ
http://lwn.net/Articles/343608/rss æ°ããgccã§ãGPLv2ã®ããã°ã©ã ãã³ã³ãã¤ã«ããã¨åé å¸ä¸å¯è½ã«ãªãããã¨ãã話ãããç¥ããã¦ããããã«ãgccã¯ã³ã³ãã¤ã«æã«ï¼åæã«ï¼libgccããªã³ã¯ãããããã¯é¤ç®ã®ãµãã¼ãçãå«ã¾ãã¦ãããããè¦ãã ãã©C++ã®ä¾å¤ã®è£å©ã³ã¼ãçãããã ãã§ãåæã«ãªã³ã¯ãããé½åä¸ãããã¾ããã¤ãå¶ç´ã«åºæ¥ãªãã®ã§GPLãªãã ãã©ãç¹å¥å é¤ã¨ãã¦ãããã©ãªã©ã¤ã»ã³ã¹ã¨ãªã³ã¯ãã¦ãOKã¨ãããã¨ã«ãã¦ãããããã¨ãããã¨ã«ãªã£ã¦ããã ã§ããã®GCC runtimeã®ã©ã¤ã»ã³ã¹ããgcc 4.4ããGPLv3ã«ãªã£ããã§ããããã©ãªã©ã¤ã»ã³ã¹ã¯å¾æ¥ã®ç¹èµ¦æ¡é ã§æãããã®ã§OKã ãã©ãGPLv2ã¯åé å¸æã«ã©ã¤ã»ã³ã¹å¤æ´ãã¡ããã¡æ¡é ãããããã¤ãGPLv2ã¨GPLv3ã¯incompatibleãªã®ã§ãèªåçã«ã©ã¤ã»ã³
#If 0ã£ã¦C,C++ã§ã¯ã#endifã¾ã§åçç¡ç¨ã§ã³ã¡ã³ãã«ãã¾ããã ããã使ã£ãããã¯ãããã便å©ã å ãã¿ http://gpwiki.org/index.php/SDL:Tutorial:Using_SDL_net #if 0 #!/bin/sh gcc -o a a.c exit #endif int main( void ) { printf( "Hello\n"); return 1; } ãããä¿åãã¦ãå®è¡å±æ§ãã¤ãã¦ãã(chmod 755ã¨ã) ã¿ã¼ããã«ã§ã # ./a.c ã¨æã¡è¾¼ãã¨ã aã¨ããå®è¡ãã¡ã¤ã«ãçæãããã ãã§ã./aã¨æã¡è¾¼ã㨠Helloã¨è¡¨ç¤ºãããã ä»ã¾ã§ã¯ãMakefileãç´æ¥ãgcc -o a a.cã¨ããã£ã¦ããä½æ¥ãã ã½ã¼ã¹ã³ã¼ãï¼Makefileã®ä»£ããã«ãªãããã ãªããããªäºãã§ãããã£ã¦ã¼ã¨ã shã®ã·ã§ã«ã¹ã¯ãª
ã©ã¤ãã©ãªã®å¤ã«å ¬éããã·ã³ãã«ãå¶éãã Cè¨èªã«ã¯ãã¡ã¤ã«å (ã³ã³ãã¤ã«åä½) ããããã¢ã¯ã»ã¹ã§ããªã static é¢æ°ã¨ãå¥ã®ãã¡ã¤ã«ãããã¢ã¯ã»ã¹ã§ããéstatic é¢æ°ãããã¾ããããããã©ã¤ãã©ãªãä½æããä¸ã§ã¯ããã®2ã¤ã®ã¹ã³ã¼ãã ãã§ã¯ä¸ååãªã¨ããããã¾ãã æ¬è¨äºã§ã¯ GNUã®éçºç°å¢ã«ããã¦ãã©ã¤ãã©ãªã®å¤ã«å ¬éããã·ã³ãã«ãå¶éããæ¹æ³ãç´¹ä»ãã¾ãã 次ã®ãããªä¾ãèãã¦ã¿ã¾ãã % cat a.c // foo() 㯠libfoo ã®ä¸»å½¹ã®é¢æ°ãªã®ã§å ¬éããã void foo() { bar(); } % cat b.c // bar() ã¯ã©ã¤ãã©ãªã®ä¸ã ãã§ä½¿ãããã¹ããªã®ã§æ¬å½ã¯å ¬é // ããããªãããããå¥ã®ãã¡ã¤ã«ã«å«ã¾ãã foo() ãã使ãã // ã¦ããã®ã§ãéstaticã«ããããããªã void bar() { } ãã®ãããªã³
C++ ã®ã·ã³ãã«ãããã³ã°ã«ãã C++ ã³ã³ãã¤ã©ã¯ã·ã³ãã«ãä¸æã®ååãæã¤ããã«ååãã³ã°ã« (name mangling) ã¨å¼ã°ããå¦çãè¡ãã¾ããæ¬è¨äºã§ã¯ GNU ã®éçºç°å¢ã§ C++ ã®ã·ã³ãã«ãããã³ã°ã« (demangle) ããæ¹æ³ãç´¹ä»ãã¾ãã ãã³ã°ã«ã®æ¹æ³ã¯ã³ã³ãã¤ã©ä¾åã§ããåãã³ã³ãã¤ã©ã§ããã¼ã¸ã§ã³ã«ãã£ã¦ãã³ã°ã«ã®æ¹æ³ãç°ãªããã¨ãããã¾ãããã¨ãã° GCC 3.x ã§ã¯ int foo(int) ã _Z3fooi ã«ã int foo(const char*) ã _Z3fooPKc ã®ããã«ãã³ã°ã«ãã¾ããã GCC 2.95 ã§ã¯ãããã foo__FPCc, foo__Fi ã¨ãªãã¾ãã ã³ãã³ãã©ã¤ã³ããããã³ã°ã« C++ ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ã« nm ããããã¨ãããã©ã«ãã§ã¯ãã³ã°ã«ãããèªã¿ã¥ããå½¢å¼ã§ã·ã³ãã«ãåºåããã¾ãã %
3. å ±æã©ã¤ãã©ãªå ±æã©ã¤ãã©ãªã¯ãããã°ã©ã èµ·åæã«ãã¼ããããã©ã¤ãã©ãªã§ãã å ±æã©ã¤ãã©ãªãé©åã«ã¤ã³ã¹ãã¼ã«ãããã¨ããã®å¾ã«èµ·åãããå ¨ã¦ã®ããã°ã©ã ã¯ãèªåçã«ãã®æ°ããå ±æã©ã¤ãã©ãªã使ããã¨ã«ãªãã¾ãã å®éã«ã¯ããããããã¯ããã«æè»ã§æ´ç·´ããã¦ãã¾ãããªããªããLinux ã«ãããå ±æã©ã¤ãã©ãªã®å®ç¾æ¹æ³ã®ãããã§ã次ã®ãã¨ãå¯è½ã¨ãªãããã§ãã ã©ã¤ãã©ãªãæ´æ°ããªãããããã®ã©ã¤ãã©ãªã®å¤ãã¦å¾æ¹äºææ§ã®ãªããã¼ã¸ã§ã³ã使ãããã¨ããããã°ã©ã ããå¼ãç¶ããµãã¼ããããã¨ãã§ããç¹å®ã®ããã°ã©ã ãå®è¡ããã¨ããç¹å®ã®ã©ã¤ãã©ãªããããã¯ã©ã¤ãã©ãªå ã®ç¹å®ã®é¢æ°ã§ããããªã¼ãã¼ã©ã¤ããããã¨ãã§ããæ¢åã®ã©ã¤ãã©ãªã使ç¨ãã¦ããã°ã©ã ãåãã¦ããéã«ãããããå ¨ã¦ããããªããã¨ãã§ãã 3.1. ç´æãã¨ãããã®æã¾ããç¹æ§ãã¹ã¦ãå ±æã©ã¤ãã©ãªããµãã¼ããããã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}