romcc: Allow adding non-existent paths to include path
This models gcc's (and other compilers') behavior to not bail out with an error when one of the include paths does not exist. Change-Id: Ic93a55cea6b32516fd76da9b49abe7b990829889 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/12469 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
This commit is contained in:
parent
48bfcdf006
commit
3d0ba1c47f
|
@ -3,8 +3,8 @@
|
||||||
#undef RELEASE_DATE
|
#undef RELEASE_DATE
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
#define VERSION_MAJOR "0"
|
#define VERSION_MAJOR "0"
|
||||||
#define VERSION_MINOR "73"
|
#define VERSION_MINOR "80"
|
||||||
#define RELEASE_DATE "08 May 2013"
|
#define RELEASE_DATE "18 November 2015"
|
||||||
#define VERSION VERSION_MAJOR "." VERSION_MINOR
|
#define VERSION VERSION_MAJOR "." VERSION_MINOR
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -1538,13 +1538,14 @@ static int append_string(size_t *max, const char ***vec, const char *str,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void arg_error(char *fmt, ...);
|
static void arg_error(char *fmt, ...);
|
||||||
|
static void arg_warning(char *fmt, ...);
|
||||||
static const char *identifier(const char *str, const char *end);
|
static const char *identifier(const char *str, const char *end);
|
||||||
|
|
||||||
static int append_include_path(struct compiler_state *compiler, const char *str)
|
static int append_include_path(struct compiler_state *compiler, const char *str)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
if (!exists(str, ".")) {
|
if (!exists(str, ".")) {
|
||||||
arg_error("Nonexistent include path: `%s'\n",
|
arg_warning("Warning: Nonexistent include path: `%s'\n",
|
||||||
str);
|
str);
|
||||||
}
|
}
|
||||||
result = append_string(&compiler->include_path_count,
|
result = append_string(&compiler->include_path_count,
|
||||||
|
@ -25083,6 +25084,15 @@ static void arg_error(char *fmt, ...)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void arg_warning(char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
vfprintf(stderr, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *filename;
|
const char *filename;
|
||||||
|
|
Loading…
Reference in New Issue