浏览代码

use prototype for function pointer in static link libc init barrier

this is not needed for correctness, but doesn't hurt, and in some
cases the compiler may pessimize the call assuming the callee might be
variadic when it lacks a prototype.
Rich Felker 6 年之前
父节点
当前提交
7eda27d025
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/env/__libc_start_main.c

+ 1 - 1
src/env/__libc_start_main.c

@@ -79,7 +79,7 @@ int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv)
 
 	/* Barrier against hoisting application code or anything using ssp
 	 * or thread pointer prior to its initialization above. */
-	int (*stage2)();
+	int (*stage2)(int (*)(int,char **,char **), int, char **);
 	__asm__ ( "" : "=r"(stage2) : "0"(libc_start_main_stage2) : "memory" );
 	return stage2(main, argc, argv);
 }