Oto przykład (dla ciekawskich), jak program jest NAPRAWDĘ długi. Jak go my widzimy: #include #include
int main(int argc, char *argv[]) { printf("%s%c", "Hello World!", '\n'); system("pause"); return 0; } (8 linijek)
Jak go widzi kompilator:
po kompilacji w kompilatorze gcc z opcją "-E":
gcc test.c -E -o test.txt
otrzymujemy plik (przykładowy; na innym komputerze i/lub kompilatorze plik może się różnić):
# 1 "test.c" # 1 "" # 1 "test.c" # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 1 3 # 9 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\crtdefs.h" 1 3 # 10 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\crtdefs.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 1 3 # 12 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_mac.h" 1 3 # 46 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_mac.h" 3
# 55 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_mac.h" 3
# 13 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 2 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_secapi.h" 1 3 # 14 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 2 3 # 282 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\vadefs.h" 1 3 # 9 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\vadefs.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 1 3 # 686 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\sdks/_mingw_directx.h" 1 3 # 687 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 2 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\sdks/_mingw_ddk.h" 1 3 # 688 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 2 3 # 10 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\vadefs.h" 2 3
#pragma pack(push,_CRT_PACKING) # 22 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\vadefs.h" 3 typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list; # 101 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\vadefs.h" 3 #pragma pack(pop) # 283 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 2 3
#pragma pack(push,_CRT_PACKING) # 377 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 __extension__ typedef unsigned long long size_t; # 387 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 __extension__ typedef long long ssize_t; # 399 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 __extension__ typedef long long intptr_t; # 412 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 __extension__ typedef unsigned long long uintptr_t; # 425 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 __extension__ typedef long long ptrdiff_t; # 435 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 typedef unsigned short wchar_t;
typedef unsigned short wint_t; typedef unsigned short wctype_t; # 463 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 typedef int errno_t;
typedef long __time32_t;
__extension__ typedef long long __time64_t;
typedef __time64_t time_t; # 656 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw.h" 3 void __attribute__((__cdecl__)) __debugbreak(void); extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) void __attribute__((__cdecl__)) __debugbreak(void) { __asm__ __volatile__("int {$}3":); }
const char *__mingw_get_crt_info (void);
#pragma pack(pop) # 11 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\crtdefs.h" 2 3 # 26 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\crtdefs.h" 3 typedef size_t rsize_t; # 153 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\crtdefs.h" 3 struct threadlocaleinfostruct; struct threadmbcinfostruct; typedef struct threadlocaleinfostruct *pthreadlocinfo; typedef struct threadmbcinfostruct *pthreadmbcinfo; struct __lc_time_data;
typedef struct localeinfo_struct { pthreadlocinfo locinfo; pthreadmbcinfo mbcinfo; } _locale_tstruct,*_locale_t;
typedef struct tagLC_ID { unsigned short wLanguage; unsigned short wCountry; unsigned short wCodePage; } LC_ID,*LPLC_ID;
typedef struct threadlocaleinfostruct { int refcount; unsigned int lc_codepage; unsigned int lc_collate_cp; unsigned long lc_handle; LC_ID lc_id; struct { char *locale; wchar_t *wlocale; int *refcount; int *wrefcount; } lc_category; int lc_clike; int mb_cur_max; int *lconv_intl_refcount; int *lconv_num_refcount; int *lconv_mon_refcount; struct lconv *lconv; int *ctype1_refcount; unsigned short *ctype1; const unsigned short *pctype; const unsigned char *pclmap; const unsigned char *pcumap; struct __lc_time_data *lc_time_curr; } threadlocinfo; # 10 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 2 3
# 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_print_push.h" 1 3 # 12 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 2 3
#pragma pack(push,_CRT_PACKING) # 26 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname;
typedef struct _iobuf FILE; # 80 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 # 1 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_off_t.h" 1 3
typedef long _off_t;
typedef long off32_t;
__extension__ typedef long long _off64_t;
__extension__ typedef long long off64_t; # 26 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\_mingw_off_t.h" 3 typedef off32_t off_t; # 81 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 2 3
__attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) __iob_func(void); # 103 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 __extension__ typedef long long fpos_t; # 139 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 extern __attribute__((__format__ (gnu_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp); extern __attribute__((__format__ (gnu_scanf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_scanf(const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vscanf(const char * __restrict__ Format, va_list argp); extern __attribute__((__format__ (gnu_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp);
extern __attribute__((__format__ (gnu_printf, 3, 0))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_vsnprintf(char * __restrict__ _DstBuf,size_t _MaxCount,const char * __restrict__ _Format, va_list _ArgList); extern __attribute__((__format__ (gnu_printf, 3, 4))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_snprintf(char * __restrict__ s, size_t n, const char * __restrict__ format, ...); extern __attribute__((__format__ (gnu_printf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_printf(const char * __restrict__ , ... ) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vprintf (const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fprintf (FILE * __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfprintf (FILE * __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_sprintf (char * __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vsprintf (char * __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2))) int __attribute__((__cdecl__)) __mingw_asprintf(char ** __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__((nonnull (1,2))) int __attribute__((__cdecl__)) __mingw_vasprintf(char ** __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); # 377 "g:\\progra~1\\dev-c++\\mingw64\\x86_64-w64-mingw32\\include\\stdio.h" 3 int __attribute__((__cdecl__)) fprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,...); int __attribute__((__cdecl__)) printf(const char * __restrict__ _Format,...); int __attribute__((__cdecl__)) sprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,...) ;
int __attribute__((__cdecl__)) vfprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,va_list _ArgList); int __attribute__((__cdecl__)) vprintf(const char * __restrict__ _Format,va_list _ArgList); int __attribute__((__cdecl__)) vsprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,va_list _Args) ;
int __attribute__((__cdecl__)) fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...) ; int __attribute__((__cdecl__)) scanf(const char * __restrict__ _Format,...) ; int __attribute__((__cdecl__)) sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...) ;
int __attribute__((__cdecl__)) __ms_vscanf(const char * __restrict__ Format, va_list argp); int __attribute__((__cdecl__)) __ms_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp); int __attribute__((__cdecl__)) __ms_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (2))) int vfscanf (FILE *__stream, const char *__format, __builtin_va_list __local_argv)
return __ms_vfscanf (__stream, __format, __local_argv);
static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (2))) int vsscanf (const char * __restrict__ __source, const char * __restrict__ __format, __builtin_va_list __local_argv)
return __ms_vsscanf( __source, __format, __local_argv );
static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (1)))