Konstantin8105 / c4go

Transpiling C code to Go code
MIT License
363 stars 37 forks source link

c4go transpile prime.c -> fail #345

Closed 69567272 closed 5 years ago

69567272 commented 5 years ago

OS:linux CentOS 7 64 bit It's conversion fail ,why?

Error: [root@localhost examples]# c4go transpile prime.c panic: interface conversion: interface is nil, not ast.Node goroutine 1 [running]: main.generateGoCode(0x0, 0xc420084080, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b422b, ...) /home/go/src/github.com/Konstantin8105/c4go/main.go:470 +0x61d main.Start(0x0, 0xc420084080, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b422b, ...) /home/go/src/github.com/Konstantin8105/c4go/main.go:337 +0x282 main.runCommand(0x0) /home/go/src/github.com/Konstantin8105/c4go/main.go:639 +0x904 main.main() /home/go/src/github.com/Konstantin8105/c4go/main.go:510 +0x22

Konstantin8105 commented 5 years ago

Hello @69567272 , Could you run c4go ast prime.c. Do you see ast dump? Could you clarify version of clang clang --version? Allowable version : clang from 3.4 to 7

69567272 commented 5 years ago

Hello, Thank for you reply! 1、[root@localhost c4go]# clang --version clang version 3.4.2 (tags/RELEASE_34/dot2-final) Target: x86_64-redhat-linux-gnu Thread model: posix

2、 c4go ast prime.c //It can be executed,But I don't understand it very well. [root@localhost examples]# c4go ast prime.c TranslationUnitDecl 0x1ea6d70 <> |-TypedefDecl 0x1ea7270 <> int128_t 'int128' |-TypedefDecl 0x1ea72d0 <> uint128_t 'unsigned int128' |-TypedefDecl 0x1ea7620 <> builtin_va_list 'va_list_tag [1]' |-TypedefDecl 0x1ea7680 </usr/bin/../lib/clang/3.4.2/include/stddef.h:34:1, col:18> ptrdiff_t 'long' |-TypedefDecl 0x1ea76e0 <line:42:1, col:27> size_t 'unsigned long' |-TypedefDecl 0x1ea7740 <line:65:1, col:13> wchar_t 'int' |-TypedefDecl 0x1ea77a0 </usr/include/bits/types.h:30:1, col:23> u_char 'unsigned char' |-TypedefDecl 0x1ea7800 <line:31:1, col:28> __u_short 'unsigned short' |-TypedefDecl 0x1ea7860 <line:32:1, col:22> u_int 'unsigned int' |-TypedefDecl 0x1ea78c0 <line:33:1, col:27> u_long 'unsigned long' |-TypedefDecl 0x1ea7920 <line:36:1, col:21> __int8_t 'signed char' |-TypedefDecl 0x1ea7980 <line:37:1, col:23> uint8_t 'unsigned char' |-TypedefDecl 0x1ea79e0 <line:38:1, col:26> int16_t 'short' |-TypedefDecl 0x1ea7a40 <line:39:1, col:28> __uint16_t 'unsigned short' |-TypedefDecl 0x1eeeb80 <line:40:1, col:20> int32_t 'int' |-TypedefDecl 0x1eeebe0 <line:41:1, col:22> uint32_t 'unsigned int' |-TypedefDecl 0x1eeec40 <line:43:1, col:25> __int64_t 'long' |-TypedefDecl 0x1eeeca0 <line:44:1, col:27> uint64_t 'unsigned long' |-TypedefDecl 0x1eeed00 <line:52:1, col:18> quad_t 'long' |-TypedefDecl 0x1eeed60 <line:53:1, col:27> u_quad_t 'unsigned long' |-TypedefDecl 0x1eeedc0 <line:133:1, col:27> dev_t 'unsigned long' |-TypedefDecl 0x1eeee20 <line:134:1, col:22> uid_t 'unsigned int' |-TypedefDecl 0x1eeee80 <line:135:1, col:22> gid_t 'unsigned int' |-TypedefDecl 0x1eeeee0 <line:136:1, col:27> __ino_t 'unsigned long' |-TypedefDecl 0x1eeef40 <line:137:1, col:27> ino64_t 'unsigned long' |-TypedefDecl 0x1eeefa0 <line:138:1, col:22> mode_t 'unsigned int' |-TypedefDecl 0x1eef000 <line:139:1, col:27> __nlink_t 'unsigned long' |-TypedefDecl 0x1eef060 <line:140:1, col:18> off_t 'long' |-TypedefDecl 0x1eef0c0 <line:141:1, col:18> off64_t 'long' |-TypedefDecl 0x1eef120 <line:142:1, col:13> __pid_t 'int' |-RecordDecl 0x1eef170 <line:143:9, col:32> struct definition | `-FieldDecl 0x1eef290 <col:18, col:29> val 'int [2]' |-TypedefDecl 0x1eef330 <col:1, col:34> fsid_t 'struct __fsid_t':'fsid_t' |-TypedefDecl 0x1eef3a0 <line:144:1, col:18> clock_t 'long' |-TypedefDecl 0x1eef400 <line:145:1, col:27> __rlim_t 'unsigned long' |-TypedefDecl 0x1eef460 <line:146:1, col:27> rlim64_t 'unsigned long' |-TypedefDecl 0x1eef4c0 <line:147:1, col:22> id_t 'unsigned int' |-TypedefDecl 0x1eef520 <line:148:1, col:18> __time_t 'long' |-TypedefDecl 0x1eef580 <line:149:1, col:22> useconds_t 'unsigned int' |-TypedefDecl 0x1eef5e0 <line:150:1, col:18> suseconds_t 'long' |-TypedefDecl 0x1eef640 <line:152:1, col:13> __daddr_t 'int' |-TypedefDecl 0x1eef6a0 <line:153:1, col:13> key_t 'int' |-TypedefDecl 0x1eef700 <line:156:1, col:13> clockid_t 'int' |-TypedefDecl 0x1eef760 <line:159:1, col:16> __timer_t 'void *' |-TypedefDecl 0x1eef7c0 <line:162:1, col:18> blksize_t 'long' |-TypedefDecl 0x1eef820 <line:167:1, col:18> blkcnt_t 'long' |-TypedefDecl 0x1eef880 <line:168:1, col:18> __blkcnt64_t 'long' |-TypedefDecl 0x1eef8e0 <line:171:1, col:27> fsblkcnt_t 'unsigned long' |-TypedefDecl 0x1eef940 <line:172:1, col:27> fsblkcnt64_t 'unsigned long' |-TypedefDecl 0x1eef9a0 <line:175:1, col:27> __fsfilcnt_t 'unsigned long' |-TypedefDecl 0x1eefa00 <line:176:1, col:27> fsfilcnt64_t 'unsigned long' |-TypedefDecl 0x1eefa60 <line:179:1, col:18> fsword_t 'long' |-TypedefDecl 0x1eefac0 <line:181:1, col:18> __ssize_t 'long' |-TypedefDecl 0x1eefb20 <line:184:1, col:18> syscall_slong_t 'long' |-TypedefDecl 0x1ef0fc0 <line:186:1, col:27> syscall_ulong_t 'unsigned long' |-TypedefDecl 0x1ef1040 <line:190:1, col:19> loff_t 'off64_t':'long' |-TypedefDecl 0x1ef1120 <line:191:1, col:19> __qaddr_t 'quad_t ' |-TypedefDecl 0x1ef11b0 <line:192:1, col:15> __caddr_t 'char ' |-TypedefDecl 0x1ef1210 <line:195:1, col:18> intptr_t 'long' |-TypedefDecl 0x1ef1270 <line:198:1, col:22> __socklen_t 'unsigned int' |-RecordDecl 0x1ef12c0 </usr/include/stdio.h:44:1, col:8> struct _IO_FILE |-TypedefDecl 0x1ef13b0 <line:48:1, col:25> FILE 'struct _IO_FILE':'struct _IO_FILE' |-TypedefDecl 0x1ef1420 <line:64:1, col:25> FILE 'struct _IO_FILE':'struct _IO_FILE' |-RecordDecl 0x1ef1470 </usr/include/wchar.h:82:9, line:94:1> struct definition | |-FieldDecl 0x1ef1520 <line:84:3, col:7> count 'int' | |-RecordDecl 0x1ef1570 <line:85:3, line:93:3> union definition | | |-FieldDecl 0x1ef1620 <line:88:5, col:18> wch 'unsigned int' | | -FieldDecl 0x1ef16f0 <line:92:5, col:18> __wchb 'char [4]' |-FieldDecl 0x1ef1790 <line:85:3, line:93:5> value 'union <anonymous union at /usr/include/wchar.h:85:3>':'union mbstate_t::<anonymous at /usr/include/wchar.h:85:3>' |-TypedefDecl 0x1ef1830 <line:82:1, line:94:3> mbstate_t 'struct __mbstate_t':'mbstate_t' |-RecordDecl 0x1ef1890 </usr/include/_G_config.h:21:9, line:25:1> struct definition | |-FieldDecl 0x1ef1960 <line:23:3, col:11> pos 'off_t':'long' | -FieldDecl 0x1ef19e0 <line:24:3, col:15> __state '__mbstate_t':'__mbstate_t' |-TypedefDecl 0x1ef1a80 <line:21:1, line:25:3> _G_fpos_t 'struct _G_fpos_t':'_G_fpos_t' |-RecordDecl 0x1ef1ae0 <line:26:9, line:30:1> struct definition | |-FieldDecl 0x1ef1b90 <line:28:3, col:13> __pos '__off64_t':'long' |-FieldDecl 0x1ef1bf0 <line:29:3, col:15> state 'mbstate_t':'mbstate_t' |-TypedefDecl 0x1ef1c90 <line:26:1, line:30:3> _G_fpos64_t 'struct _G_fpos64_t':'_G_fpos64_t' |-TypedefDecl 0x1ef1d20 </usr/bin/../lib/clang/3.4.2/include/stdarg.h:30:1, col:27> va_list 'builtin_va_list':'va_list_tag [1]' |-TypedefDecl 0x1ef1d80 <line:48:1, col:27> gnuc_va_list 'builtin_va_list':'__va_list_tag [1]' |-RecordDecl 0x1ef1dd0 </usr/include/libio.h:145:1, col:8> struct _IO_jump_t |-RecordDecl 0x1ef1e70 prev 0x1ef12c0 <col:20, col:27> struct _IO_FILE |-TypedefDecl 0x1ef1f00 <line:155:1, col:14> _IO_lock_t 'void' |-RecordDecl 0x1ef2b70 <line:161:1, line:178:1> struct _IO_marker definition | |-FieldDecl 0x1ef2cc0 <line:162:3, col:22> _next 'struct _IO_marker ' | |-FieldDecl 0x1ef2d90 <line:163:3, col:20> _sbuf 'struct _IO_FILE ' | `-FieldDecl 0x1ef2df0 <line:167:3, col:7> _pos 'int' |-EnumDecl 0x1ef2e40 <line:181:1, line:187:1> codecvt_result | |-EnumConstantDecl 0x1ef2ef0 codecvt_ok 'int' | |-EnumConstantDecl 0x1ef2f40 __codecvt_partial 'int' | |-EnumConstantDecl 0x1ef2f90 codecvt_error 'int' | -EnumConstantDecl 0x1ef2fe0 <line:186:3> __codecvt_noconv 'int' |-RecordDecl 0x1ef3030 prev 0x1ef1e70 <line:246:1, line:313:1> struct _IO_FILE definition | |-FieldDecl 0x1ef30c0 <line:247:3, col:7> _flags 'int' | |-FieldDecl 0x1ef3120 <line:252:3, col:9> _IO_read_ptr 'char *' | |-FieldDecl 0x1ef3180 <line:253:3, col:9> _IO_read_end 'char *' | |-FieldDecl 0x1ef31e0 <line:254:3, col:9> _IO_read_base 'char *' | |-FieldDecl 0x1ef3240 <line:255:3, col:9> _IO_write_base 'char *' | |-FieldDecl 0x1ef32a0 <line:256:3, col:9> _IO_write_ptr 'char *' | |-FieldDecl 0x1ef3300 <line:257:3, col:9> _IO_write_end 'char *' | |-FieldDecl 0x1ef3360 <line:258:3, col:9> _IO_buf_base 'char *' | |-FieldDecl 0x1ef33c0 <line:259:3, col:9> _IO_buf_end 'char *' | |-FieldDecl 0x1ef3420 <line:261:3, col:9> _IO_save_base 'char *' | |-FieldDecl 0x1ef3480 <line:262:3, col:9> _IO_backup_base 'char *' | |-FieldDecl 0x1ef34e0 <line:263:3, col:9> _IO_save_end 'char *' | |-FieldDecl 0x1ef3550 <line:265:3, col:22> _markers 'struct _IO_marker *' | |-FieldDecl 0x1ef35c0 <line:267:3, col:20> _chain 'struct _IO_FILE *' | |-FieldDecl 0x1ef3620 <line:269:3, col:7> _fileno 'int' | |-FieldDecl 0x1ef3680 <line:273:3, col:7> _flags2 'int' | |-FieldDecl 0x1ef36e0 <line:275:3, col:11> _old_offset '__off_t':'long' | |-FieldDecl 0x1ef3740 <line:279:3, col:18> _cur_column 'unsigned short' | |-FieldDecl 0x1ef37a0 <line:280:3, col:15> _vtable_offset 'signed char' | |-FieldDecl 0x1ef3870 <line:281:3, col:19> _shortbuf 'char [1]' | |-FieldDecl 0x1ef3920 <line:285:3, col:15> _lock '_IO_lock_t *' | |-FieldDecl 0x1ef3980 <line:294:3, col:13> _offset '__off64_t':'long' | |-FieldDecl 0x1ef39e0 <line:303:3, col:9> __pad1 'void *' | |-FieldDecl 0x1ef3a40 <line:304:3, col:9> __pad2 'void *' | |-FieldDecl 0x1ef3aa0 <line:305:3, col:9> __pad3 'void *' | |-FieldDecl 0x1ef3b00 <line:306:3, col:9> __pad4 'void *' | |-FieldDecl 0x1ef3bb0 <line:307:3, col:10> __pad5 'size_t':'unsigned long' | |-FieldDecl 0x1ef3c10 <line:309:3, col:7> _mode 'int' |-FieldDecl 0x1ef3e60 <line:311:3, col:74> _unused2 'char [20]' |-TypedefDecl 0x1ef3ed0 <line:316:1, col:25> _IO_FILE 'struct _IO_FILE':'struct _IO_FILE' |-RecordDecl 0x1ef3f20 <line:319:1, col:8> struct _IO_FILE_plus |-VarDecl 0x1ef4010 <line:321:1, col:29> _IO_2_1stdin 'struct _IO_FILE_plus':'struct _IO_FILE_plus' extern |-VarDecl 0x1ef4090 <line:322:1, col:29> _IO_2_1stdout 'struct _IO_FILE_plus':'struct _IO_FILE_plus' extern |-VarDecl 0x1ef4110 <line:323:1, col:29> _IO_2_1stderr 'struct _IO_FILE_plus':'struct _IO_FILE_plus' extern |-TypedefDecl 0x1ef43b0 <line:339:1, col:77> io_read_fn 'ssize_t (void , char , size_t)' |-TypedefDecl 0x1ef4650 <line:347:1, line:348:16> io_write_fn 'ssize_t (void , const char , size_t)' |-TypedefDecl 0x1ef48f0 <line:356:1, col:68> io_seek_fn 'int (void *, off64_t , int)' |-TypedefDecl 0x1ef4a10 <line:359:1, col:42> __io_close_fn 'int (void )' |-TypedefDecl 0x1ef4a90 <line:364:1, col:22> cookie_read_function_t 'io_read_fn':'ssize_t (void , char , size_t)' |-TypedefDecl 0x1ef4b10 <line:365:1, col:23> cookie_write_function_t 'io_write_fn':'ssize_t (void , const char , size_t)' |-TypedefDecl 0x1efbbf0 <line:366:1, col:22> cookie_seek_function_t 'io_seek_fn':'int (void *, off64_t , int)' |-TypedefDecl 0x1efbc70 <line:367:1, col:23> cookie_close_function_t '__io_close_fn':'int (void )' |-RecordDecl 0x1efbcc0 <line:370:9, line:376:1> struct definition | |-FieldDecl 0x1efbdd0 <line:372:3, col:17> read 'io_read_fn *' | |-FieldDecl 0x1efbe90 <line:373:3, col:18> write 'io_write_fn ' | |-FieldDecl 0x1efbf50 <line:374:3, col:17> seek '__io_seek_fn ' | -FieldDecl 0x1efc010 <line:375:3, col:18> close '__io_close_fn *' |-TypedefDecl 0x1efc0b0 <line:370:1, line:376:3> _IO_cookie_io_functions_t 'struct _IO_cookie_io_functions_t':'_IO_cookie_io_functions_t' |-TypedefDecl 0x1efc140 <line:377:1, col:35> cookie_io_functions_t '_IO_cookie_io_functions_t':'_IO_cookie_io_functions_t' |-RecordDecl 0x1efc190 <line:379:1, col:8> struct _IO_cookie_file |-FunctionDecl 0x1efc570 <line:382:1, line:383:56> _IO_cookie_init 'void (struct _IO_cookie_file *, int, void *, _IO_cookie_io_functions_t)' extern | |-ParmVarDecl 0x1efc2e0 <line:382:30, col:54> __cfile 'struct _IO_cookie_file *' | |-ParmVarDecl 0x1efc350 <col:63, col:67> __read_write 'int' | |-ParmVarDecl 0x1efc3c0 <line:383:9, col:15> __cookie 'void *' |-ParmVarDecl 0x1efc430 <col:25, col:51> fns '_IO_cookie_io_functions_t':'_IO_cookie_io_functions_t' |-FunctionDecl 0x1efc790 <line:391:1, col:35> underflow 'int (_IO_FILE )' extern | `-ParmVarDecl 0x1efc690 <col:25, col:35> '_IO_FILE ' |-FunctionDecl 0x1efc8d0 <line:392:1, col:31> uflow 'int (_IO_FILE )' extern | `-ParmVarDecl 0x1efc850 <col:21, col:31> '_IO_FILE ' |-FunctionDecl 0x1efcb10 <line:393:1, col:39> overflow 'int (_IO_FILE , int)' extern | |-ParmVarDecl 0x1efc990 <col:24, col:34> '_IO_FILE ' | -ParmVarDecl 0x1efca00 <col:36, col:39> 'int' |-FunctionDecl 0x1efcc70 <line:435:1, col:36> _IO_getc 'int (_IO_FILE *)' extern |-ParmVarDecl 0x1efcbf0 <col:22, col:32> fp '_IO_FILE ' |-FunctionDecl 0x1efceb0 <line:436:1, col:45> _IO_putc 'int (int, _IO_FILE )' extern | |-ParmVarDecl 0x1efcd30 <col:22, col:26> c 'int' | -ParmVarDecl 0x1efcda0 <col:31, col:41> __fp '_IO_FILE *' |-FunctionDecl 0x1efcff0 <line:437:1, col:66> _IO_feof 'int (_IO_FILE *)' extern | |-ParmVarDecl 0x1efcf70 <col:22, col:32> __fp '_IO_FILE *' |-NoThrowAttr 0x1efd0a0 |-FunctionDecl 0x1efd170 <line:438:1, col:68> _IO_ferror 'int (_IO_FILE )' extern | |-ParmVarDecl 0x1efd0f0 <col:24, col:34> __fp '_IO_FILE ' | -NoThrowAttr 0x1efd220 <col:56> |-FunctionDecl 0x1efd2f0 <line:440:1, col:44> _IO_peekc_locked 'int (_IO_FILE *)' extern |-ParmVarDecl 0x1efd270 <col:30, col:40> fp '_IO_FILE ' |-FunctionDecl 0x1efd4b0 <line:446:1, col:68> _IO_flockfile 'void (_IO_FILE )' extern | |-ParmVarDecl 0x1efd3b0 <col:28, col:38> '_IO_FILE ' | `-NoThrowAttr 0x1efd560 |-FunctionDecl 0x1efd630 <line:447:1, col:70> _IO_funlockfile 'void (_IO_FILE )' extern | |-ParmVarDecl 0x1efd5b0 <col:30, col:40> '_IO_FILE ' | `-NoThrowAttr 0x1efd6e0 |-FunctionDecl 0x1efd7b0 <line:448:1, col:70> _IO_ftrylockfile 'int (_IO_FILE )' extern | |-ParmVarDecl 0x1efd730 <col:30, col:40> '_IO_FILE ' | `-NoThrowAttr 0x1efd860 |-FunctionDecl 0x1eff8a0 <line:465:1, line:466:35> _IO_vfscanf 'int (_IO_FILE restrict, const char *restrict, va_list_tag , int restrict)' extern | |-ParmVarDecl 0x1efd8b0 <line:465:25, col:46> '_IO_FILE restrict' | |-ParmVarDecl 0x1efd920 <col:48, col:71> 'const char restrict' | |-ParmVarDecl 0x1efda40 <line:466:4, col:18> 'va_list_tag *':'va_list_tag ' | `-ParmVarDecl 0x1efdae0 <col:20, col:35> 'int restrict' |-FunctionDecl 0x1effb80 <line:467:1, line:468:19> _IO_vfprintf 'int (_IO_FILE restrict, const char restrict, va_list_tag )' extern | |-ParmVarDecl 0x1eff970 <line:467:26, col:46> '_IO_FILE restrict' | |-ParmVarDecl 0x1eff9e0 <col:48, col:70> 'const char *restrict' | `-ParmVarDecl 0x1effa50 <line:468:5, col:19> 'va_list_tag ':'__va_list_tag ' |-FunctionDecl 0x1effe60 <line:469:1, col:54> _IO_padn 'ssize_t (_IO_FILE , int, __ssize_t)' extern | |-ParmVarDecl 0x1effc50 <col:28, col:38> '_IO_FILE ' | |-ParmVarDecl 0x1effcc0 <col:40, col:43> 'int' | `-ParmVarDecl 0x1effd30 <col:45, col:54> 'ssize_t':'long' |-FunctionDecl 0x1f00140 <line:470:1, col:52> _IO_sgetn 'size_t (_IO_FILE , void , size_t)' extern | |-ParmVarDecl 0x1efff30 <col:26, col:36> '_IO_FILE ' | |-ParmVarDecl 0x1efffa0 <col:38, col:44> 'void ' | -ParmVarDecl 0x1f00010 <col:46, col:52> 'size_t':'unsigned long' |-FunctionDecl 0x1f004a0 <line:472:1, col:62> _IO_seekoff '__off64_t (_IO_FILE *, __off64_t, int, int)' extern | |-ParmVarDecl 0x1f00210 <col:31, col:41> '_IO_FILE *' | |-ParmVarDecl 0x1f00280 <col:43, col:52> '__off64_t':'long' | |-ParmVarDecl 0x1f002f0 <col:54, col:57> 'int' |-ParmVarDecl 0x1f00360 <col:59, col:62> 'int' |-FunctionDecl 0x1f01020 <line:473:1, col:57> _IO_seekpos 'off64_t (_IO_FILE , __off64_t, int)' extern | |-ParmVarDecl 0x1f00570 <col:31, col:41> '_IO_FILE ' | |-ParmVarDecl 0x1f005e0 <col:43, col:52> 'off64_t':'long' | -ParmVarDecl 0x1f00650 <col:54, col:57> 'int' |-FunctionDecl 0x1f01170 <line:475:1, col:75> _IO_free_backup_area 'void (_IO_FILE *)' extern | |-ParmVarDecl 0x1f010f0 <col:35, col:45> '_IO_FILE *' |-NoThrowAttr 0x1f01220 |-TypedefDecl 0x1f01270 prev 0x1ef1d20 </usr/include/stdio.h:79:1, col:24> va_list 'gnuc_va_list':'va_list_tag [1]' |-TypedefDecl 0x1f012d0 <line:90:1, col:17> off_t 'off_t':'long' |-TypedefDecl 0x1f01330 <line:97:1, col:19> off64_t 'off64_t':'long' |-TypedefDecl 0x1f01390 <line:102:1, col:19> ssize_t 'ssize_t':'long' |-TypedefDecl 0x1f01410 <line:110:1, col:19> fpos_t '_G_fpos_t':'_G_fpos_t' |-TypedefDecl 0x1f01490 <line:116:1, col:21> fpos64_t '_G_fpos64_t':'_G_fpos64_t' |-VarDecl 0x1f01500 <line:168:1, col:25> stdin 'struct _IO_FILE ' extern |-VarDecl 0x1f01580 <line:169:1, col:25> stdout 'struct _IO_FILE ' extern |-VarDecl 0x1f01600 <line:170:1, col:25> stderr 'struct _IO_FILE ' extern |-FunctionDecl 0x1f01730 <line:178:1, col:72> remove 'int (const char )' extern | |-ParmVarDecl 0x1f01670 <col:20, col:32> filename 'const char ' | `-NoThrowAttr 0x1f017e0 |-FunctionDecl 0x1f01970 <line:180:1, col:86> rename 'int (const char , const char *)' extern | |-ParmVarDecl 0x1f01830 <col:20, col:32> old 'const char ' | |-ParmVarDecl 0x1f018a0 <col:39, col:51> __new 'const char ' | -NoThrowAttr 0x1f01a20 <col:74> |-FunctionDecl 0x1f01cb0 <line:185:1, line:186:55> renameat 'int (int, const char *, int, const char *)' extern | |-ParmVarDecl 0x1f01a70 <line:185:22, col:26> __oldfd 'int' | |-ParmVarDecl 0x1f01ae0 <col:35, col:47> __old 'const char *' | |-ParmVarDecl 0x1f01b50 <col:54, col:58> __newfd 'int' | |-ParmVarDecl 0x1f01bc0 <line:186:8, col:20> __new 'const char *' |-NoThrowAttr 0x1f01d70 |-FunctionDecl 0x1f01ef0 <line:195:1, col:27> tmpfile 'FILE (void)' extern |-FunctionDecl 0x1f02050 <line:205:1, col:29> tmpfile64 'FILE (void)' extern |-FunctionDecl 0x1f021c0 <line:209:1, col:61> tmpnam 'char (char )' extern | |-ParmVarDecl 0x1f02100 <col:22, col:28> __s 'char ' | `-NoThrowAttr 0x1f02270 |-FunctionDecl 0x1f02340 <line:215:1, col:63> tmpnam_r 'char (char *)' extern | |-ParmVarDecl 0x1f022c0 <col:24, col:30> s 'char ' | `-NoThrowAttr 0x1f023f0 |-FunctionDecl 0x1f02580 <line:227:1, line:228:63> tempnam 'char (const char , const char )' extern | |-ParmVarDecl 0x1f02440 <line:227:23, col:35> dir 'const char *' | |-ParmVarDecl 0x1f024b0 <col:42, col:54> pfx 'const char ' | |-MallocAttr 0x1f02630 | `-NoThrowAttr 0x1f02670 |-FunctionDecl 0x1f02760 <line:237:1, col:34> fclose 'int (FILE )' extern | -ParmVarDecl 0x1f026a0 <col:20, col:26> __stream 'FILE *' |-FunctionDecl 0x1f028a0 <line:242:1, col:34> fflush 'int (FILE *)' extern |-ParmVarDecl 0x1f02820 <col:20, col:26> stream 'FILE ' |-FunctionDecl 0x1f029e0 <line:252:1, col:43> fflush_unlocked 'int (FILE )' extern | -ParmVarDecl 0x1f02960 <col:29, col:35> __stream 'FILE *' |-FunctionDecl 0x1f02b50 <line:262:1, col:27> fcloseall 'int (void)' extern |-FunctionDecl 0x1f02d80 <line:272:1, line:273:37> fopen 'FILE *(const char *restrict, const char *restrict)' extern | |-ParmVarDecl 0x1f02c00 <line:272:21, col:44> __filename 'const char *restrict' |-ParmVarDecl 0x1f02c70 <line:273:7, col:30> modes 'const char restrict' |-FunctionDecl 0x1f03080 <line:278:1, line:280:34> freopen 'FILE (const char restrict, const char restrict, FILE *restrict)' extern | |-ParmVarDecl 0x1f02e40 <line:278:23, col:46> filename 'const char restrict' | |-ParmVarDecl 0x1f02eb0 <line:279:9, col:32> __modes 'const char restrict' | -ParmVarDecl 0x1f02f20 <line:280:9, col:26> __stream 'FILE *restrict' |-FunctionDecl 0x1f03250 <line:297:1, line:298:39> fopen64 'FILE *(const char *restrict, const char *restrict)' extern | |-ParmVarDecl 0x1f03150 <line:297:23, col:46> __filename 'const char *restrict' |-ParmVarDecl 0x1f031c0 <line:298:9, col:32> modes 'const char restrict' |-FunctionDecl 0x1f03480 <line:299:1, line:301:29> freopen64 'FILE (const char restrict, const char restrict, FILE *restrict)' extern | |-ParmVarDecl 0x1f03310 <line:299:25, col:48> filename 'const char restrict' | |-ParmVarDecl 0x1f03380 <line:300:4, col:27> __modes 'const char restrict' | -ParmVarDecl 0x1f033f0 <line:301:4, col:21> __stream 'FILE *restrict' |-FunctionDecl 0x1f036d0 <line:306:1, col:81> fdopen 'FILE *(int, const char *)' extern | |-ParmVarDecl 0x1f03550 <col:22, col:26> __fd 'int' | |-ParmVarDecl 0x1f035c0 <col:32, col:44> __modes 'const char *' |-NoThrowAttr 0x1f03780 |-FunctionDecl 0x1f039e0 <line:312:1, line:314:72> fopencookie 'FILE (void restrict, const char *restrict, _IO_cookie_io_functions_t)' extern | |-ParmVarDecl 0x1f037d0 <line:312:27, col:44> magic_cookie 'void restrict' | |-ParmVarDecl 0x1f03840 <line:313:6, col:29> __modes 'const char restrict' | |-ParmVarDecl 0x1f038b0 <line:314:6, col:32> io_funcs '_IO_cookie_io_functions_t':'_IO_cookie_io_functions_t' | `-NoThrowAttr 0x1f03aa0 |-FunctionDecl 0x1f03d00 <line:319:1, line:320:31> fmemopen 'FILE (void , size_t, const char *)' extern | |-ParmVarDecl 0x1f03af0 <line:319:24, col:30> s 'void ' | |-ParmVarDecl 0x1f03b60 <col:35, col:42> __len 'size_t':'unsigned long' | |-ParmVarDecl 0x1f03bd0 <col:49, col:61> __modes 'const char ' | -NoThrowAttr 0x1f03dc0 <line:320:19> |-FunctionDecl 0x1f06fe0 <line:325:1, col:94> open_memstream 'FILE *(char **, size_t *)' extern | |-ParmVarDecl 0x1f03e40 <col:30, col:37> __bufloc 'char **' | |-ParmVarDecl 0x1f03f10 <col:47, col:55> __sizeloc 'size_t *' |-NoThrowAttr 0x1f07090 |-FunctionDecl 0x1f07260 <line:332:1, col:100> setbuf 'void (FILE restrict, char restrict)' extern | |-ParmVarDecl 0x1f070e0 <col:21, col:38> stream 'FILE *restrict' | |-ParmVarDecl 0x1f07150 <col:48, col:65> buf 'char restrict' | `-NoThrowAttr 0x1f07310 |-FunctionDecl 0x1f075f0 <line:336:1, line:337:60> setvbuf 'int (FILE restrict, char restrict, int, size_t)' extern | |-ParmVarDecl 0x1f07360 <line:336:21, col:38> __stream 'FILE restrict' | |-ParmVarDecl 0x1f073d0 <col:48, col:65> buf 'char *restrict' | |-ParmVarDecl 0x1f07440 <line:337:7, col:11> modes 'int' | |-ParmVarDecl 0x1f074b0 <col:20, col:27> n 'size_t':'unsigned long' | `-NoThrowAttr 0x1f076b0 |-FunctionDecl 0x1f07910 <line:343:1, line:344:53> setbuffer 'void (FILE restrict, char restrict, size_t)' extern | |-ParmVarDecl 0x1f07700 <line:343:24, col:41> stream 'FILE restrict' | |-ParmVarDecl 0x1f07770 <col:51, col:68> __buf 'char restrict' | |-ParmVarDecl 0x1f077e0 <line:344:10, col:17> size 'size_t':'unsigned long' | -NoThrowAttr 0x1f079d0 <col:41> |-FunctionDecl 0x1f07ae0 <line:347:1, col:69> setlinebuf 'void (FILE *)' extern | |-ParmVarDecl 0x1f07a20 <col:25, col:31> __stream 'FILE *' |-NoThrowAttr 0x1f07b90 |-FunctionDecl 0x1f07da0 fprintf 'int (FILE , const char , ...)' extern | |-ParmVarDecl 0x1f07e40 <> 'FILE ' | |-ParmVarDecl 0x1f07ea0 <> 'const char ' | -FormatAttr 0x1f07f10 <col:12> printf 2 3 |-FunctionDecl 0x1f07ff0 prev 0x1f07da0 <col:1, line:357:43> fprintf 'int (FILE *, const char *, ...)' extern | |-ParmVarDecl 0x1f07be0 <line:356:21, col:38> __stream 'FILE *restrict' | |-ParmVarDecl 0x1f07c50 <line:357:7, col:30> __format 'const char *restrict' |-FormatAttr 0x1f080d0 printf 2 3 |-FunctionDecl 0x1f08210 printf 'int (const char , ...)' extern | |-ParmVarDecl 0x1f082b0 <> 'const char ' | -FormatAttr 0x1f08310 <col:12> printf 1 2 |-FunctionDecl 0x1f08360 prev 0x1f08210 <col:1, col:56> printf 'int (const char *, ...)' extern | |-ParmVarDecl 0x1f08110 <col:20, col:43> __format 'const char *restrict' |-FormatAttr 0x1f08430 printf 1 2 |-FunctionDecl 0x1f085f0 sprintf 'int (char , const char , ...)' extern | |-ParmVarDecl 0x1f08690 <> 'char ' | |-ParmVarDecl 0x1f086f0 <> 'const char ' | -FormatAttr 0x1f08760 <col:12> printf 2 3 |-FunctionDecl 0x1f087b0 prev 0x1f085f0 <col:1, line:365:73> sprintf 'int (char *, const char *, ...)' extern | |-ParmVarDecl 0x1f08470 <line:364:21, col:38> __s 'char *restrict' | |-ParmVarDecl 0x1f084e0 <line:365:7, col:30> __format 'const char *restrict' | |-NoThrowAttr 0x1f08860 <col:61> |-FormatAttr 0x1f088a0 printf 2 3 |-FunctionDecl 0x1f08ad0 vfprintf 'int ()' extern | -FormatAttr 0x1f08b70 <col:12> printf 2 0 |-FunctionDecl 0x1f08bc0 prev 0x1f08ad0 <col:1, line:372:28> vfprintf 'int (FILE *restrict, const char *restrict, __va_list_tag *)' extern | |-ParmVarDecl 0x1f088e0 <line:371:22, col:39> __s 'FILE *restrict' | |-ParmVarDecl 0x1f08950 <col:44, col:67> __format 'const char *restrict' | |-ParmVarDecl 0x1f089c0 <line:372:8, col:23> __arg '__va_list_tag *':'__va_list_tag *' |-FormatAttr 0x1f08ca0 printf 2 0 |-FunctionDecl 0x1f08ea0 vprintf 'int (const char , __va_list_tag )' extern | |-ParmVarDecl 0x1f08f40 <> 'const char ' | |-ParmVarDecl 0x1f09000 <> '__va_list_tag ' | -FormatAttr 0x1f09070 <col:12> printf 1 0 |-FunctionDecl 0x1f090c0 prev 0x1f08ea0 <col:1, col:74> vprintf 'int (const char *, __va_list_tag *)' extern | |-ParmVarDecl 0x1f08ce0 <col:21, col:44> __format 'const char *restrict' | |-ParmVarDecl 0x1f08d50 <col:54, col:69> __arg '__va_list_tag *':'__va_list_tag *' |-FormatAttr 0x1f091a0 printf 1 0 |-FunctionDecl 0x1f09440 vsprintf 'int (char , const char , va_list_tag )' extern | |-ParmVarDecl 0x1f094e0 <> 'char ' | |-ParmVarDecl 0x1f09540 <> 'const char *' | |-ParmVarDecl 0x1f095a0 <> 'va_list_tag ' | `-FormatAttr 0x1f09610 printf 2 0 |-FunctionDecl 0x1f09660 prev 0x1f09440 <col:1, line:380:58> vsprintf 'int (char , const char , __va_list_tag )' extern | |-ParmVarDecl 0x1f091e0 <line:379:22, col:39> s 'char *restrict' | |-ParmVarDecl 0x1f09250 <col:44, col:67> format 'const char restrict' | |-ParmVarDecl 0x1f092c0 <line:380:8, col:23> arg 'va_list_tag ':'va_list_tag ' | |-NoThrowAttr 0x1f09720 | `-FormatAttr 0x1f09760 printf 2 0 |-FunctionDecl 0x1f09a00 snprintf 'int (char , unsigned long, const char , ...)' extern | |-ParmVarDecl 0x1f09aa0 <> 'char ' | |-ParmVarDecl 0x1f09b00 <> 'unsigned long' | |-ParmVarDecl 0x1f09b60 <> 'const char ' | `-FormatAttr 0x1f09bd0 printf 3 4 |-FunctionDecl 0x1f09c20 prev 0x1f09a00 <col:1, line:388:82> snprintf 'int (char , unsigned long, const char *, ...)' extern | |-ParmVarDecl 0x1f097a0 <line:386:22, col:39> s 'char *restrict' | |-ParmVarDecl 0x1f09810 <col:44, col:51> __maxlen 'size_t':'unsigned long' | |-ParmVarDecl 0x1f09880 <line:387:8, col:31> format 'const char restrict' | |-FormatAttr 0x1f09ce0 <line:388:52, col:80> printf 3 4 | `-NoThrowAttr 0x1f09d30 |-FunctionDecl 0x1f0a0f0 vsnprintf 'int (char , unsigned long, const char , __va_list_tag )' extern | |-ParmVarDecl 0x1f0a190 <> 'char ' | |-ParmVarDecl 0x1f0a1f0 <> 'unsigned long' | |-ParmVarDecl 0x1f0a250 <> 'const char ' | |-ParmVarDecl 0x1f0a2b0 <> 'va_list_tag ' | `-FormatAttr 0x1f0a330 printf 3 0 |-FunctionDecl 0x1f0a380 prev 0x1f0a0f0 <col:1, line:392:82> vsnprintf 'int (char , unsigned long, const char *, va_list_tag )' extern | |-ParmVarDecl 0x1f09d60 <line:390:23, col:40> __s 'char restrict' | |-ParmVarDecl 0x1f09dd0 <col:45, col:52> maxlen 'size_t':'unsigned long' | |-ParmVarDecl 0x1f09e40 <line:391:9, col:32> format 'const char *restrict' | |-ParmVarDecl 0x1f09eb0 <col:42, col:57> arg 'va_list_tag *':'va_list_tag *' | |-FormatAttr 0x1f0a440 <line:392:52, col:80> printf 3 0 | -NoThrowAttr 0x1f0a490 <col:22> |-FunctionDecl 0x1f0a720 <line:399:1, line:401:82> vasprintf 'int (char **restrict, const char *restrict, __va_list_tag *)' extern | |-ParmVarDecl 0x1f0a4c0 <line:399:23, col:41> __ptr 'char **restrict' | |-ParmVarDecl 0x1f0a530 <col:48, col:71> __f 'const char *restrict' | |-ParmVarDecl 0x1f0a5a0 <line:400:9, col:24> __arg '__va_list_tag *':'__va_list_tag *' | |-FormatAttr 0x1f0a7e0 <line:401:52, col:80> printf 2 0 |-NoThrowAttr 0x1f0a830 |-FunctionDecl 0x1f0aa30 <line:402:1, line:404:82> asprintf 'int (char *restrict, const char restrict, ...)' extern | |-ParmVarDecl 0x1f0a860 <line:402:24, col:42> ptr 'char restrict' | |-ParmVarDecl 0x1f0a8d0 <line:403:10, col:33> fmt 'const char *restrict' | |-FormatAttr 0x1f0aae0 <line:404:52, col:80> printf 2 3 | `-NoThrowAttr 0x1f0ab30 |-FunctionDecl 0x1f0acb0 <line:405:1, line:407:82> asprintf 'int (char *restrict, const char restrict, ...)' extern | |-ParmVarDecl 0x1f0ab60 <line:405:22, col:40> ptr 'char restrict' | |-ParmVarDecl 0x1f0abd0 <line:406:8, col:31> fmt 'const char restrict' | |-FormatAttr 0x1f0ad60 <line:407:52, col:80> printf 2 3 | `-NoThrowAttr 0x1f0adb0 |-FunctionDecl 0x1f0b0a0 <line:412:1, line:414:52> vdprintf 'int (int, const char restrict, va_list_tag )' extern | |-ParmVarDecl 0x1f0ade0 <line:412:22, col:26> fd 'int' | |-ParmVarDecl 0x1f0ae50 <col:32, col:55> fmt 'const char restrict' | |-ParmVarDecl 0x1f0aec0 <line:413:8, col:23> arg 'va_list_tag ':'__va_list_tag ' | -FormatAttr 0x1f0b160 <line:414:22, col:50> printf 2 0 |-FunctionDecl 0x1f0b390 <line:415:1, line:416:52> dprintf 'int (int, const char *restrict, ...)' extern | |-ParmVarDecl 0x1f0b1c0 <line:415:21, col:25> __fd 'int' | |-ParmVarDecl 0x1f0b230 <col:31, col:54> __fmt 'const char *restrict' |-FormatAttr 0x1f0b440 <line:416:22, col:50> printf 2 3 |-FunctionDecl 0x1f0b5a0 fscanf 'int (FILE restrict, const char restrict, ...)' extern | |-ParmVarDecl 0x1f0b640 <> 'FILE restrict' | |-ParmVarDecl 0x1f0b6a0 <> 'const char restrict' | -FormatAttr 0x1f0b710 <col:12> scanf 2 3 |-FunctionDecl 0x1f0b760 prev 0x1f0b5a0 <col:1, line:426:42> fscanf 'int (FILE *restrict, const char *restrict, ...)' extern | |-ParmVarDecl 0x1f0b4a0 <line:425:20, col:37> __stream 'FILE *restrict' | |-ParmVarDecl 0x1f0b510 <line:426:6, col:29> __format 'const char *restrict' |-FormatAttr 0x1f0b840 scanf 2 3 |-FunctionDecl 0x1f0b900 scanf 'int (const char restrict, ...)' extern | |-ParmVarDecl 0x1f0b9a0 <> 'const char restrict' | -FormatAttr 0x1f0ba00 <col:12> scanf 1 2 |-FunctionDecl 0x1f0ba50 prev 0x1f0b900 <col:1, col:55> scanf 'int (const char *restrict, ...)' extern | |-ParmVarDecl 0x1f0b880 <col:19, col:42> __format 'const char *restrict' |-FormatAttr 0x1f0bb20 scanf 1 2 |-FunctionDecl 0x1f0bce0 sscanf 'int (const char restrict, const char restrict, ...)' extern | |-ParmVarDecl 0x1f0bd80 <> 'const char restrict' | |-ParmVarDecl 0x1f0bde0 <> 'const char restrict' | -FormatAttr 0x1f0be50 <col:12> scanf 2 3 |-FunctionDecl 0x1f0bea0 prev 0x1f0bce0 <col:1, line:434:72> sscanf 'int (const char *restrict, const char *restrict, ...)' extern | |-ParmVarDecl 0x1f0bb60 <line:433:20, col:43> __s 'const char *restrict' | |-ParmVarDecl 0x1f0bbd0 <line:434:6, col:29> __format 'const char *restrict' | |-NoThrowAttr 0x1f0bf50 <col:60> |-FormatAttr 0x1f0bf90 scanf 2 3 |-FunctionDecl 0x1f0c250 vfscanf 'int (FILE restrict, const char restrict, va_list_tag )' extern | |-ParmVarDecl 0x1f0c2f0 <> 'FILE restrict' | |-ParmVarDecl 0x1f0c350 <> 'const char *restrict' | |-ParmVarDecl 0x1f0c3b0 <> 'va_list_tag ' | `-FormatAttr 0x1f0c420 scanf 2 0 |-FunctionDecl 0x1f0c470 prev 0x1f0c250 <col:1, line:473:51> vfscanf 'int (FILE restrict, const char restrict, __va_list_tag )' extern | |-ParmVarDecl 0x1f0c030 <line:471:21, col:38> s 'FILE *restrict' | |-ParmVarDecl 0x1f0c0a0 <col:43, col:66> format 'const char restrict' | |-ParmVarDecl 0x1f0c110 <line:472:7, col:22> arg 'va_list_tag ':'va_list_tag ' | `-FormatAttr 0x1f0c530 <line:473:22, col:49> scanf 2 0 |-FunctionDecl 0x1f0c720 vscanf 'int (const char restrict, va_list_tag )' extern | |-ParmVarDecl 0x1f0c7c0 <> 'const char restrict' | |-ParmVarDecl 0x1f0c820 <> 'va_list_tag ' | `-FormatAttr 0x1f0c890 scanf 1 0 |-FunctionDecl 0x1f0c8e0 prev 0x1f0c720 <col:1, line:480:51> vscanf 'int (const char restrict, va_list_tag )' extern | |-ParmVarDecl 0x1f0c590 <line:479:20, col:43> __format 'const char restrict' | |-ParmVarDecl 0x1f0c600 <col:53, col:68> arg 'va_list_tag ':'__va_list_tag ' | -FormatAttr 0x1f0c990 <line:480:22, col:49> scanf 1 0 |-FunctionDecl 0x1f0cca0 <line:483:12> vsscanf 'int (const char *restrict, const char *restrict, __va_list_tag *)' extern | |-ParmVarDecl 0x1f0cd40 <<invalid sloc>> 'const char *restrict' | |-ParmVarDecl 0x1f0cda0 <<invalid sloc>> 'const char *restrict' | |-ParmVarDecl 0x1f0ce00 <<invalid sloc>> '__va_list_tag *' |-FormatAttr 0x1f0ce70 scanf 2 0 |-FunctionDecl 0x1f0cec0 prev 0x1f0cca0 <col:1, line:485:81> vsscanf 'int (const char restrict, const char restrict, va_list_tag *)' extern | |-ParmVarDecl 0x1f0c9f0 <line:483:21, col:44> s 'const char restrict' | |-ParmVarDecl 0x1f0ca60 <line:484:7, col:30> __format 'const char restrict' | |-ParmVarDecl 0x1f0cad0 <col:40, col:55> arg 'va_list_tag ':'__va_list_tag ' | |-FormatAttr 0x1f0cf80 <line:485:52, col:79> scanf 2 0 | -NoThrowAttr 0x1f0cfd0 <col:22> |-FunctionDecl 0x1f0d8d0 <line:531:1, col:33> fgetc 'int (FILE *)' extern |-ParmVarDecl 0x1f0d850 <col:19, col:25> stream 'FILE ' |-FunctionDecl 0x1f0da10 <line:532:1, col:32> getc 'int (FILE )' extern | `-ParmVarDecl 0x1f0d990 <col:18, col:24> stream 'FILE ' |-FunctionDecl 0x1f0db50 <line:538:1, col:25> getchar 'int (void)' extern |-FunctionDecl 0x1f0dc80 <line:550:1, col:41> getc_unlocked 'int (FILE )' extern | `-ParmVarDecl 0x1f0dc00 <col:27, col:33> stream 'FILE ' |-FunctionDecl 0x1f0ddc0 <line:551:1, col:34> getchar_unlocked 'int (void)' extern |-FunctionDecl 0x1f0def0 <line:561:1, col:42> fgetc_unlocked 'int (FILE )' extern | -ParmVarDecl 0x1f0de70 <col:28, col:34> __stream 'FILE *' |-FunctionDecl 0x1f0e0f0 <line:573:1, col:42> fputc 'int (int, FILE *)' extern | |-ParmVarDecl 0x1f0dfb0 <col:19, col:23> __c 'int' |-ParmVarDecl 0x1f0e020 <col:28, col:34> stream 'FILE ' |-FunctionDecl 0x1f0e2b0 <line:574:1, col:41> putc 'int (int, FILE )' extern | |-ParmVarDecl 0x1f0e1b0 <col:18, col:22> c 'int' | -ParmVarDecl 0x1f0e220 <col:27, col:33> __stream 'FILE *' |-FunctionDecl 0x1f0e430 <line:580:1, col:28> putchar 'int (int)' extern |-ParmVarDecl 0x1f0e370 <col:21, col:25> c 'int' |-FunctionDecl 0x1f0e5f0 <line:594:1, col:51> fputc_unlocked 'int (int, FILE )' extern | |-ParmVarDecl 0x1f0e4f0 <col:28, col:32> c 'int' | `-ParmVarDecl 0x1f0e560 <col:37, col:43> stream 'FILE ' |-FunctionDecl 0x1f0e860 <line:602:1, col:50> putc_unlocked 'int (int, FILE *)' extern | |-ParmVarDecl 0x1f0e6b0 <col:27, col:31> c 'int' | -ParmVarDecl 0x1f0e720 <col:36, col:42> __stream 'FILE *' |-FunctionDecl 0x1f0e9a0 <line:603:1, col:37> putchar_unlocked 'int (int)' extern |-ParmVarDecl 0x1f0e920 <col:30, col:34> c 'int' |-FunctionDecl 0x1f0eae0 <line:610:1, col:32> getw 'int (FILE *)' extern | `-ParmVarDecl 0x1f0ea60 <col:18, col:24> stream 'FILE ' |-FunctionDecl 0x1f0eca0 <line:613:1, col:41> putw 'int (int, FILE )' extern | |-ParmVarDecl 0x1f0eba0 <col:18, col:22> w 'int' | `-ParmVarDecl 0x1f0ec10 <col:27, col:33> stream 'FILE ' |-FunctionDecl 0x1f0ef70 <line:622:1, col:77> fgets 'char (char restrict, int, FILE restrict)' extern | |-ParmVarDecl 0x1f0ed60 <col:21, col:38> s 'char *restrict' | |-ParmVarDecl 0x1f0edd0 <col:43, col:47> n 'int' | -ParmVarDecl 0x1f0ee40 <col:52, col:69> __stream 'FILE *restrict' |-FunctionDecl 0x1f0f1b0 <line:649:1, line:650:34> fgets_unlocked 'char *(char *restrict, int, FILE *restrict)' extern | |-ParmVarDecl 0x1f0f040 <line:649:30, col:47> __s 'char *restrict' | |-ParmVarDecl 0x1f0f0b0 <col:52, col:56> __n 'int' |-ParmVarDecl 0x1f0f120 <line:650:9, col:26> stream 'FILE *restrict' |-FunctionDecl 0x1f0f510 <line:665:1, line:667:36> getdelim 'ssize_t (char *restrict, size_t restrict, int, FILE *restrict)' extern | |-ParmVarDecl 0x1f0f280 <line:665:30, col:48> lineptr 'char restrict' | |-ParmVarDecl 0x1f0f2f0 <line:666:11, col:30> __n 'size_t restrict' | |-ParmVarDecl 0x1f0f360 <col:35, col:39> delimiter 'int' | `-ParmVarDecl 0x1f0f3d0 <line:667:11, col:28> stream 'FILE restrict' |-FunctionDecl 0x1f0f870 <line:668:1, line:670:34> getdelim '__ssize_t (char restrict, size_t restrict, int, FILE restrict)' extern | |-ParmVarDecl 0x1f0f5f0 <line:668:28, col:46> lineptr 'char **restrict' | |-ParmVarDecl 0x1f0f660 <line:669:9, col:28> n 'size_t restrict' | |-ParmVarDecl 0x1f0f6d0 <col:33, col:37> delimiter 'int' | `-ParmVarDecl 0x1f0f740 <line:670:9, col:26> stream 'FILE restrict' |-FunctionDecl 0x1f0fb60 <line:678:1, line:680:33> getline 'ssize_t (char *restrict, size_t restrict, FILE *restrict)' extern | |-ParmVarDecl 0x1f0f950 <line:678:27, col:45> lineptr 'char *restrict' | |-ParmVarDecl 0x1f0f9c0 <line:679:8, col:27> __n 'size_t restrict' | -ParmVarDecl 0x1f0fa30 <line:680:8, col:25> __stream 'FILE *restrict' |-FunctionDecl 0x1f0fdb0 <line:689:1, col:72> fputs 'int (const char *restrict, FILE *restrict)' extern | |-ParmVarDecl 0x1f0fc30 <col:19, col:42> __s 'const char *restrict' |-ParmVarDecl 0x1f0fca0 <col:47, col:64> stream 'FILE restrict' |-FunctionDecl 0x1f0fef0 <line:695:1, col:33> puts 'int (const char )' extern | `-ParmVarDecl 0x1f0fe70 <col:18, col:30> s 'const char ' |-FunctionDecl 0x1f100b0 <line:702:1, col:43> ungetc 'int (int, FILE )' extern | |-ParmVarDecl 0x1f0ffb0 <col:20, col:24> c 'int' | `-ParmVarDecl 0x1f10020 <col:29, col:35> stream 'FILE ' |-FunctionDecl 0x1f10400 <line:709:1, line:710:45> fread 'size_t (void restrict, size_t, size_t, FILE restrict)' extern | |-ParmVarDecl 0x1f10170 <line:709:22, col:39> __ptr 'void restrict' | |-ParmVarDecl 0x1f101e0 <col:46, col:53> size 'size_t':'unsigned long' | |-ParmVarDecl 0x1f10250 <line:710:8, col:15> __n 'size_t':'unsigned long' | `-ParmVarDecl 0x1f102c0 <col:20, col:37> stream 'FILE restrict' |-FunctionDecl 0x1f10790 <line:715:1, line:716:41> fwrite 'size_t (const void restrict, size_t, size_t, FILE restrict)' extern | |-ParmVarDecl 0x1f10500 <line:715:23, col:46> __ptr 'const void restrict' | |-ParmVarDecl 0x1f10570 <col:53, col:60> size 'size_t':'unsigned long' | |-ParmVarDecl 0x1f105e0 <line:716:9, col:16> __n 'size_t':'unsigned long' | `-ParmVarDecl 0x1f10650 <col:21, col:38> s 'FILE restrict' |-FunctionDecl 0x1f10980 <line:726:1, line:727:32> fputs_unlocked 'int (const char restrict, FILE restrict)' extern | |-ParmVarDecl 0x1f10880 <line:726:28, col:51> __s 'const char restrict' | -ParmVarDecl 0x1f108f0 <line:727:7, col:24> __stream 'FILE *restrict' |-FunctionDecl 0x1f10c30 <line:737:1, line:738:47> fread_unlocked 'size_t (void *restrict, size_t, size_t, FILE *restrict)' extern | |-ParmVarDecl 0x1f10a40 <line:737:31, col:48> __ptr 'void *restrict' | |-ParmVarDecl 0x1f10ab0 <col:55, col:62> __size 'size_t':'unsigned long' | |-ParmVarDecl 0x1f10b20 <line:738:10, col:17> __n 'size_t':'unsigned long' |-ParmVarDecl 0x1f10b90 <col:22, col:39> stream 'FILE restrict' |-FunctionDecl 0x1f10ef0 <line:739:1, line:740:48> fwrite_unlocked 'size_t (const void restrict, size_t, size_t, FILE *restrict)' extern | |-ParmVarDecl 0x1f10d00 <line:739:32, col:55> ptr 'const void restrict' | |-ParmVarDecl 0x1f10d70 <col:62, col:69> size 'size_t':'unsigned long' | |-ParmVarDecl 0x1f10de0 <line:740:11, col:18> __n 'size_t':'unsigned long' | `-ParmVarDecl 0x1f10e50 <col:23, col:40> stream 'FILE restrict' |-FunctionDecl 0x1f111d0 <line:749:1, col:63> fseek 'int (FILE , long, int)' extern | |-ParmVarDecl 0x1f10fc0 <col:19, col:25> __stream 'FILE ' | |-ParmVarDecl 0x1f11030 <col:35, col:44> off 'long' | `-ParmVarDecl 0x1f110a0 <col:51, col:55> whence 'int' |-FunctionDecl 0x1f113a0 <line:754:1, col:38> ftell 'long (FILE )' extern | `-ParmVarDecl 0x1f112a0 <col:24, col:30> __stream 'FILE ' |-FunctionDecl 0x1f114e0 <line:759:1, col:35> rewind 'void (FILE )' extern | `-ParmVarDecl 0x1f11460 <col:21, col:27> __stream 'FILE ' |-FunctionDecl 0x1f11760 <line:773:1, col:63> fseeko 'int (FILE , __off_t, int)' extern | |-ParmVarDecl 0x1f115a0 <col:20, col:26> __stream 'FILE ' | |-ParmVarDecl 0x1f11610 <col:36, col:44> off 'off_t':'long' | -ParmVarDecl 0x1f11680 <col:51, col:55> __whence 'int' |-FunctionDecl 0x1f11950 <line:778:1, col:38> ftello '__off_t (FILE *)' extern |-ParmVarDecl 0x1f11890 <col:24, col:30> stream 'FILE ' |-FunctionDecl 0x1f11c10 <line:798:1, col:72> fgetpos 'int (FILE restrict, fpos_t restrict)' extern | |-ParmVarDecl 0x1f11a10 <col:21, col:38> __stream 'FILE restrict' | -ParmVarDecl 0x1f11b00 <col:48, col:67> __pos 'fpos_t *restrict' |-FunctionDecl 0x1f11eb0 <line:803:1, col:56> fsetpos 'int (FILE *, const fpos_t *)' extern | |-ParmVarDecl 0x1f11cd0 <col:21, col:27> __stream 'FILE *' |-ParmVarDecl 0x1f11da0 <col:37, col:51> __pos 'const fpos_t ' |-FunctionDecl 0x1f12130 <line:818:1, col:67> fseeko64 'int (FILE , off64_t, int)' extern | |-ParmVarDecl 0x1f11f70 <col:22, col:28> stream 'FILE *' | |-ParmVarDecl 0x1f11fe0 <col:38, col:48> off 'off64_t':'long' | -ParmVarDecl 0x1f12050 <col:55, col:59> __whence 'int' |-FunctionDecl 0x1f122c0 <line:819:1, col:42> ftello64 '__off64_t (FILE *)' extern |-ParmVarDecl 0x1f12200 <col:28, col:34> stream 'FILE ' |-FunctionDecl 0x1f12580 <line:820:1, col:76> fgetpos64 'int (FILE restrict, fpos64_t restrict)' extern | |-ParmVarDecl 0x1f12380 <col:23, col:40> __stream 'FILE restrict' | -ParmVarDecl 0x1f12470 <col:50, col:71> __pos 'fpos64_t *restrict' |-FunctionDecl 0x1f138b0 <line:821:1, col:60> fsetpos64 'int (FILE *, const fpos64_t *)' extern | |-ParmVarDecl 0x1f12640 <col:23, col:29> __stream 'FILE *' |-ParmVarDecl 0x1f12710 <col:39, col:55> pos 'const fpos64_t ' |-FunctionDecl 0x1f139f0 <line:826:1, col:67> clearerr 'void (FILE )' extern | |-ParmVarDecl 0x1f13970 <col:23, col:29> stream 'FILE ' | `-NoThrowAttr 0x1f13aa0 |-FunctionDecl 0x1f13b70 <line:828:1, col:62> feof 'int (FILE )' extern | |-ParmVarDecl 0x1f13af0 <col:18, col:24> stream 'FILE ' | `-NoThrowAttr 0x1f13c20 |-FunctionDecl 0x1f13cf0 <line:830:1, col:64> ferror 'int (FILE )' extern | |-ParmVarDecl 0x1f13c70 <col:20, col:26> __stream 'FILE ' | `-NoThrowAttr 0x1f13da0 |-FunctionDecl 0x1f13e70 <line:835:1, col:76> clearerr_unlocked 'void (FILE )' extern | |-ParmVarDecl 0x1f13df0 <col:32, col:38> stream 'FILE ' | `-NoThrowAttr 0x1f13f20 |-FunctionDecl 0x1f13ff0 <line:836:1, col:71> feof_unlocked 'int (FILE )' extern | |-ParmVarDecl 0x1f13f70 <col:27, col:33> stream 'FILE ' | `-NoThrowAttr 0x1f140a0 |-FunctionDecl 0x1f14170 <line:837:1, col:73> ferror_unlocked 'int (FILE )' extern | |-ParmVarDecl 0x1f140f0 <col:29, col:35> stream 'FILE ' | `-NoThrowAttr 0x1f14220 |-FunctionDecl 0x1f14330 <line:846:1, col:36> perror 'void (const char )' extern | `-ParmVarDecl 0x1f14270 <col:21, col:33> s 'const char ' |-VarDecl 0x1f143f0 </usr/include/bits/sys_errlist.h:26:1, col:12> sys_nerr 'int' extern |-VarDecl 0x1f144d0 <line:27:1, col:38> sys_errlist 'const char const []' extern |-VarDecl 0x1f14540 <line:30:1, col:12> _sys_nerr 'int' extern |-VarDecl 0x1f145c0 <line:31:1, col:39> _sys_errlist 'const char const []' extern |-FunctionDecl 0x1f146b0 </usr/include/stdio.h:858:1, col:64> fileno 'int (FILE )' extern | |-ParmVarDecl 0x1f14630 <col:20, col:26> stream 'FILE ' | `-NoThrowAttr 0x1f14760 |-FunctionDecl 0x1f158d0 <line:863:1, col:73> fileno_unlocked 'int (FILE )' extern | |-ParmVarDecl 0x1f147b0 <col:29, col:35> stream 'FILE ' | `-NoThrowAttr 0x1f15980 |-FunctionDecl 0x1f15b10 <line:873:1, col:63> popen 'FILE (const char , const char )' extern | |-ParmVarDecl 0x1f159d0 <col:21, col:33> command 'const char ' | `-ParmVarDecl 0x1f15a40 <col:44, col:56> __modes 'const char ' |-FunctionDecl 0x1f15c50 <line:879:1, col:34> pclose 'int (FILE )' extern | `-ParmVarDecl 0x1f15bd0 <col:20, col:26> __stream 'FILE ' |-FunctionDecl 0x1f15d90 <line:885:1, col:62> ctermid 'char (char )' extern | |-ParmVarDecl 0x1f15d10 <col:23, col:29> s 'char ' | `-NoThrowAttr 0x1f15e40 |-FunctionDecl 0x1f15f10 <line:891:1, col:32> cuserid 'char (char *)' extern | `-ParmVarDecl 0x1f15e90 <col:23, col:29> s 'char ' |-RecordDecl 0x1f15fc0 <line:896:1, col:8> struct obstack |-FunctionDecl 0x1f162e0 <line:899:1, line:901:82> obstack_printf 'int (struct obstack restrict, const char restrict, ...)' extern | |-ParmVarDecl 0x1f16110 <line:899:28, col:55> __obstack 'struct obstack restrict' | |-ParmVarDecl 0x1f16180 <line:900:7, col:30> __format 'const char restrict' | |-FormatAttr 0x1f16390 <line:901:52, col:80> printf 2 3 | `-NoThrowAttr 0x1f163e0 |-FunctionDecl 0x1f16680 <line:902:1, line:905:82> obstack_vprintf 'int (struct obstack restrict, const char restrict, __va_list_tag )' extern | |-ParmVarDecl 0x1f16420 <line:902:29, col:56> obstack 'struct obstack *restrict' | |-ParmVarDecl 0x1f16490 <line:903:8, col:31> format 'const char restrict' | |-ParmVarDecl 0x1f16500 <line:904:8, col:23> args 'va_list_tag ':'va_list_tag ' | |-FormatAttr 0x1f16740 <line:905:52, col:80> printf 2 0 | `-NoThrowAttr 0x1f16790 |-FunctionDecl 0x1f178e0 <line:913:1, col:68> flockfile 'void (FILE )' extern | |-ParmVarDecl 0x1f167c0 <col:24, col:30> stream 'FILE ' | `-NoThrowAttr 0x1f17990 |-FunctionDecl 0x1f17a60 <line:917:1, col:70> ftrylockfile 'int (FILE )' extern | |-ParmVarDecl 0x1f179e0 <col:26, col:32> stream 'FILE ' | `-NoThrowAttr 0x1f17b10 |-FunctionDecl 0x1f17be0 <line:920:1, col:70> funlockfile 'void (FILE )' extern | |-ParmVarDecl 0x1f17b60 <col:26, col:32> stream 'FILE ' | -NoThrowAttr 0x1f17c90 <col:58> -FunctionDecl 0x1f17cf0 </home/go/src/github.com/Konstantin8105/c4go/examples/prime.c:3:1, line:26:1> main 'int ()' -CompoundStmt 0x1f18b08 <line:4:1, line:26:1> |-DeclStmt 0x1f17e80 <line:5:5, col:13> | |-VarDecl 0x1f17da0 <col:5, col:9> n 'int' |-VarDecl 0x1f17e10 <col:5, col:12> c 'int' |-CallExpr 0x1f17f70 <line:7:5, col:30> 'int' | |-ImplicitCastExpr 0x1f17f58 'int ()(const char , ...)' | | `-DeclRefExpr 0x1f17e98 'int (const char , ...)' Function 0x1f08360 'printf' 'int (const char , ...)' | `-ImplicitCastExpr 0x1f17fb8 'const char ' | -ImplicitCastExpr 0x1f17fa0 <col:12> 'char *' <ArrayToPointerDecay> |-StringLiteral 0x1f17ef8 'char [16]' lvalue "Enter a number\n" |-CallExpr 0x1f180f0 <line:9:5, col:19> 'int' | |-ImplicitCastExpr 0x1f180d8 'int ()(const char restrict, ...)' | | -DeclRefExpr 0x1f17fd0 <col:5> 'int (const char *restrict, ...)' Function 0x1f0ba50 'scanf' 'int (const char *restrict, ...)' | |-ImplicitCastExpr 0x1f18140 <col:11> 'const char *' <BitCast> | |-ImplicitCastExpr 0x1f18128 'char ' | | -StringLiteral 0x1f18038 <col:11> 'char [3]' lvalue "%d" |-UnaryOperator 0x1f18090 <col:17, col:18> 'int ' prefix '&' | -DeclRefExpr 0x1f18068 <col:18> 'int' lvalue Var 0x1f17da0 'n' 'int' |-CallExpr 0x1f18238 <line:10:5, col:36> 'int' | |-ImplicitCastExpr 0x1f18220 <col:5> 'int (*)(const char *, ...)' <FunctionToPointerDecay> | |-DeclRefExpr 0x1f18158 'int (const char , ...)' Function 0x1f08360 'printf' 'int (const char , ...)' | |-ImplicitCastExpr 0x1f18288 'const char ' | | `-ImplicitCastExpr 0x1f18270 'char ' | | -StringLiteral 0x1f181b8 <col:12> 'char [19]' lvalue "The number is: %d\n" |-ImplicitCastExpr 0x1f182a0 'int' | -DeclRefExpr 0x1f181f8 <col:35> 'int' lvalue Var 0x1f17da0 'n' 'int' |-IfStmt 0x1f18a98 <line:13:5, line:24:5> | |-<<<NULL>>> | |-BinaryOperator 0x1f18318 <line:13:9, col:14> 'int' '==' | | |-ImplicitCastExpr 0x1f18300 <col:9> 'int' <LValueToRValue> | | |-DeclRefExpr 0x1f182b8 'int' lvalue Var 0x1f17da0 'n' 'int' | | -IntegerLiteral 0x1f182e0 <col:14> 'int' 2 | |-CallExpr 0x1f183f8 <line:14:9, col:33> 'int' | | |-ImplicitCastExpr 0x1f183e0 <col:9> 'int (*)(const char *, ...)' <FunctionToPointerDecay> | | |-DeclRefExpr 0x1f18340 'int (const char , ...)' Function 0x1f08360 'printf' 'int (const char , ...)' | | -ImplicitCastExpr 0x1f18440 <col:16> 'const char *' <BitCast> | |-ImplicitCastExpr 0x1f18428 'char ' | | -StringLiteral 0x1f183a8 <col:16> 'char [15]' lvalue "Prime number.\n" |-CompoundStmt 0x1f18a70 <line:15:10, line:24:5> | |-ForStmt 0x1f18750 <line:16:9, line:19:9> | | |-BinaryOperator 0x1f184a0 <line:16:14, col:18> 'int' '=' | | | |-DeclRefExpr 0x1f18458 'int' lvalue Var 0x1f17e10 'c' 'int' | | | -IntegerLiteral 0x1f18480 <col:18> 'int' 2 | | |-<<<NULL>>> | | |-BinaryOperator 0x1f18590 <col:21, col:30> 'int' '<=' | | | |-ImplicitCastExpr 0x1f18578 <col:21> 'int' <LValueToRValue> | | | |-DeclRefExpr 0x1f184c8 'int' lvalue Var 0x1f17e10 'c' 'int' | | | -BinaryOperator 0x1f18550 <col:26, col:30> 'int' '-' | | | |-ImplicitCastExpr 0x1f18538 <col:26> 'int' <LValueToRValue> | | | |-DeclRefExpr 0x1f184f0 'int' lvalue Var 0x1f17da0 'n' 'int' | | | -IntegerLiteral 0x1f18518 <col:30> 'int' 1 | | |-UnaryOperator 0x1f185e0 <col:33, col:34> 'int' postfix '++' | | |-DeclRefExpr 0x1f185b8 'int' lvalue Var 0x1f17e10 'c' 'int' | | -CompoundStmt 0x1f18730 <col:38, line:19:9> | |-IfStmt 0x1f18700 <line:17:13, line:18:17> | | |-<<>> | | |-BinaryOperator 0x1f186c8 <line:17:17, col:26> 'int' '==' | | | |-BinaryOperator 0x1f18680 <col:17, col:21> 'int' '%' | | | | |-ImplicitCastExpr 0x1f18650 'int' | | | | | -DeclRefExpr 0x1f18600 <col:17> 'int' lvalue Var 0x1f17da0 'n' 'int' | | | |-ImplicitCastExpr 0x1f18668 'int' | | | | -DeclRefExpr 0x1f18628 <col:21> 'int' lvalue Var 0x1f17e10 'c' 'int' | | |-IntegerLiteral 0x1f186a8 'int' 0 | | |-BreakStmt 0x1f186f0 | | -<<<NULL>>> |-IfStmt 0x1f18a40 <line:20:9, line:23:37> | |-<<>> | |-BinaryOperator 0x1f18810 <line:20:13, col:18> 'int' '!=' | | |-ImplicitCastExpr 0x1f187e0 'int' | | | -DeclRefExpr 0x1f18790 <col:13> 'int' lvalue Var 0x1f17e10 'c' 'int' | |-ImplicitCastExpr 0x1f187f8 'int' | | `-DeclRefExpr 0x1f187b8 'int' lvalue Var 0x1f17da0 'n' 'int' | |-CallExpr 0x1f18908 <line:21:13, col:34> 'int' | | |-ImplicitCastExpr 0x1f188f0 'int ()(const char , ...)' | | | `-DeclRefExpr 0x1f18838 'int (const char , ...)' Function 0x1f08360 'printf' 'int (const char , ...)' | | `-ImplicitCastExpr 0x1f18950 'const char ' | | -ImplicitCastExpr 0x1f18938 <col:20> 'char *' <ArrayToPointerDecay> | |-StringLiteral 0x1f18898 'char [12]' lvalue "Not prime.\n" | -CallExpr 0x1f189e0 <line:23:13, col:37> 'int' | |-ImplicitCastExpr 0x1f189c8 <col:13> 'int (*)(const char *, ...)' <FunctionToPointerDecay> | |-DeclRefExpr 0x1f18968 'int (const char , ...)' Function 0x1f08360 'printf' 'int (const char , ...)' | -ImplicitCastExpr 0x1f18a28 <col:20> 'const char *' <BitCast> |-ImplicitCastExpr 0x1f18a10 'char *' | -StringLiteral 0x1f18990 <col:20> 'char [15]' lvalue "Prime number.\n" -ReturnStmt 0x1f18ae8 <line:25:5, col:12> `-IntegerLiteral 0x1f18ac8 'int' 0

Konstantin8105 commented 5 years ago

Dear @69567272 , In my point of view you have to update clang, because that version of clang create a strange NULL node. May be I will fix that later.

69567272 commented 5 years ago

OK. Thank you for you help me, Thanks!

Konstantin8105 commented 5 years ago

Dear @69567272 , Please try again. Please clarify - is it still important for you?

69567272 commented 5 years ago

Dear @Konstantin8105 These days are busy, go to the Foxcnn factory every day, Today, the source code installed Clang. package: Cfe-3.5.0.src.tar.xz Compiler-rt-3.5.0.src.tar.xz Llv3-3.5.0.src.tar.xz After upgrading to 3.5.0 (yum is not up to 3.5.0), it's convert OK.

  1. Is it important to me? I am also a programmer. I found the problem and then gave the question back to the author. This is a habit.

  2. Suggestion: Explain the clang version, which is more convenient for everyone to use. This tool is very good and can help more programmers to complete the C code conversion GO code. Thank you so much.

69567272 commented 5 years ago

Version 3.4.* will still fail. But it doesn't matter, it's good to convert with the new version.

Konstantin8105 commented 5 years ago

Thank you for clarification. Good luck.