[test-suite] r232124 - Declare getopt() instead of including unistd.h
Matthias Braun
matze at braunis.de
Thu Mar 12 17:02:31 PDT 2015
Author: matze
Date: Thu Mar 12 19:02:30 2015
New Revision: 232124
URL: http://llvm.org/viewvc/llvm-project?rev=232124&view=rev
Log:
Declare getopt() instead of including unistd.h
I previously added a #include <unistd.h> to fix an implicit-declaration
problem of getopt(). This benchmark however comes with its own version
of getopt. This somehow failed LTO builds (the code in getopt.c maybe having a
slightly different ABI then what you get when including unistd.h).
Don't include unistd.h anymore and use an "int getopt();" forward
declaration instead.
Modified:
test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/unix-smail/main.c
Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/unix-smail/main.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/unix-smail/main.c?rev=232124&r1=232123&r2=232124&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/unix-smail/main.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/unix-smail/main.c Thu Mar 12 19:02:30 2015
@@ -37,10 +37,11 @@ static char *sccsid="@(#)main.c 2.5 (sm
#include <stdio.h>
#include <ctype.h>
-#include <unistd.h>
#include <stdlib.h>
#include "defs.h"
+int getopt();
+
int exitstat = 0; /* exit status, set by resolve, deliver */
enum edebug debug = NO; /* set by -d or -v option */
More information about the llvm-commits
mailing list