Date: Tue, 9 Oct 2012 11:29:44 +1100 (EST) From: Peter Jeremy <peter@rulingia.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/172542: [patch] FICL assumes standalone environment for testmain Message-ID: <201210090029.q990Timr082859@server.rulingia.com> Resent-Message-ID: <201210092230.q99MUMbX043597@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 172542
>Category: bin
>Synopsis: [patch] FICL assumes standalone environment for testmain
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Oct 09 22:30:22 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Peter Jeremy
>Release: FreeBSD 8.3-STABLE amd64
>Organization:
n/a
>Environment:
System: FreeBSD server.rulingia.com 8.3-STABLE FreeBSD 8.3-STABLE #18 r237444M: Sun Jul 8 10:47:08 EST 2012 root@server.rulingia.com:/var/obj/usr/src/sys/server amd64
>Description:
When ficl is compiled as a userland program via "make
testmain", loader.c reports a number of warnings (and -Wall
adds more) because required header files are missing from the
TESTMAIN case. A number of auto variables are also declared
incorrectly relative to '#ifdef TESTMAIN' blocks.
>How-To-Repeat:
# cd /sys/boot/ficl
# make testmain
note warnings when compiling loader.c
>Fix:
Index: sys/boot/ficl/loader.c
===================================================================
--- sys/boot/ficl/loader.c (revision 241347)
+++ sys/boot/ficl/loader.c (working copy)
@@ -34,10 +34,14 @@
#ifdef TESTMAIN
#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <time.h>
#else
#include <stand.h>
+#include "bootstrap.h"
#endif
-#include "bootstrap.h"
#include <string.h>
#include "ficl.h"
@@ -135,9 +139,9 @@
ficlGetenv(FICL_VM *pVM)
{
#ifndef TESTMAIN
- char *name;
+ char *name, *value;
#endif
- char *namep, *value;
+ char *namep;
int names;
#if FICL_ROBUST > 1
@@ -243,9 +247,9 @@
ficlFindfile(FICL_VM *pVM)
{
#ifndef TESTMAIN
- char *name;
+ char *type, *name;
#endif
- char *type, *namep, *typep;
+ char *namep, *typep;
struct preloaded_file* fp;
int names, types;
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210090029.q990Timr082859>
