[test-suite] r232124 - Declare getopt() instead of including unistd.h

Joerg Sonnenberger joerg at britannica.bec.de
Thu Mar 12 17:21:49 PDT 2015


On Fri, Mar 13, 2015 at 12:02:31AM -0000, Matthias Braun wrote:
> 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.

Why are you using a non-prototype here?

Joerg



More information about the llvm-commits mailing list