[commit] r759 - in trunk/fcode-utils-devel: detok romheaders toke

Author: stepan Date: Mon Apr 26 19:01:01 2010 New Revision: 759 URL: http://tracker.coreboot.org/trac/openbios/changeset/759 Log: warning free build on OS X 10.5.8 Modified: trunk/fcode-utils-devel/detok/Makefile trunk/fcode-utils-devel/detok/addfcodes.c trunk/fcode-utils-devel/detok/decode.c trunk/fcode-utils-devel/detok/pcihdr.c trunk/fcode-utils-devel/detok/stream.c trunk/fcode-utils-devel/romheaders/Makefile trunk/fcode-utils-devel/toke/Makefile Modified: trunk/fcode-utils-devel/detok/Makefile ============================================================================== --- trunk/fcode-utils-devel/detok/Makefile Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/detok/Makefile Mon Apr 26 19:01:01 2010 (r759) @@ -29,7 +29,7 @@ INCLUDES = -I../shared # Normal Flags: -CFLAGS = -O2 -Wall -Wextra +CFLAGS = -O2 -Wall -ansi #-Wextra LDFLAGS = # Coverage: Modified: trunk/fcode-utils-devel/detok/addfcodes.c ============================================================================== --- trunk/fcode-utils-devel/detok/addfcodes.c Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/detok/addfcodes.c Mon Apr 26 19:01:01 2010 (r759) @@ -98,9 +98,9 @@ **************************************************************************** */ static char *current_vfc_line; -static char *vfc_remainder; +static u8 *vfc_remainder; static int vfc_line_no = 0; -static char *vfc_buf_end; +static u8 *vfc_buf_end; /* Special Functions List */ /* Initial fcode-field value of -1 guarantees they won't be used */ @@ -173,12 +173,12 @@ { bool retval = FALSE; /* TRUE = not at end yet */ while (vfc_remainder < vfc_buf_end) { - current_vfc_line = vfc_remainder; - vfc_remainder = strchr(current_vfc_line, '\n'); + current_vfc_line = (char *)vfc_remainder; + vfc_remainder = (u8 *)strchr((const char *)current_vfc_line, '\n'); *vfc_remainder = 0; vfc_remainder++; vfc_line_no++; - skip_whitespace(¤t_vfc_line); + skip_whitespace((char **)¤t_vfc_line); if (*current_vfc_line == 0) continue; /* Blank line */ if (*current_vfc_line == '#') Modified: trunk/fcode-utils-devel/detok/decode.c ============================================================================== --- trunk/fcode-utils-devel/detok/decode.c Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/detok/decode.c Mon Apr 26 19:01:01 2010 (r759) @@ -357,7 +357,7 @@ { u16 token; u8 len; - u8 *string; + char *string; output_token(); /* get forth string ( [len] [char0] ... [charn] ) */ Modified: trunk/fcode-utils-devel/detok/pcihdr.c ============================================================================== --- trunk/fcode-utils-devel/detok/pcihdr.c Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/detok/pcihdr.c Mon Apr 26 19:01:01 2010 (r759) @@ -461,7 +461,7 @@ } else { sprintf(temp_buf, "PCI Image padding-field of %d bytes " "had first non-zero byte at offset %ld", - filler_len, scan_ptr - filler_ptr); + filler_len, (unsigned long)(scan_ptr - filler_ptr)); } printremark(temp_buf); } Modified: trunk/fcode-utils-devel/detok/stream.c ============================================================================== --- trunk/fcode-utils-devel/detok/stream.c Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/detok/stream.c Mon Apr 26 19:01:01 2010 (r759) @@ -236,7 +236,7 @@ throw_eof(TRUE); } pc += nbytes; - return (retval); + return retval; } @@ -252,7 +252,7 @@ { bool retval; retval = INVERSE(pc == max); - return (retval); + return retval; } @@ -282,7 +282,7 @@ tok |= *(get_bytes(1)); } fcode = tok; - return (tok); + return tok; } u32 get_num32(void) @@ -293,7 +293,7 @@ num_str = get_bytes(4); retval = BIG_ENDIAN_LONG_FETCH(num_str); - return (retval); + return retval; } u16 get_num16(void) @@ -304,7 +304,7 @@ num_str = get_bytes(2); retval = BIG_ENDIAN_WORD_FETCH(num_str); - return (retval); + return retval; } u8 get_num8(void) @@ -326,7 +326,7 @@ retval |= (retval & 0x80) ? 0xff00 : 0; } - return (retval); + return retval; } /* ************************************************************************** @@ -356,12 +356,12 @@ u8 *get_string(u8 * len) { - char *retval; + u8 *retval; *len = get_num8(); retval = get_bytes((int) *len); - return (retval); + return retval; } @@ -405,7 +405,7 @@ char *retval; u8 sav_byt; - str_start = get_string(len); + str_start = (char *)get_string(len); sav_byt = *pc; *pc = 0; @@ -413,7 +413,7 @@ retval = strdup(str_start); *pc = sav_byt; - return (retval); + return retval; } /* ************************************************************************** @@ -462,7 +462,7 @@ } pc = save_pc; - return (retval); + return retval; } Modified: trunk/fcode-utils-devel/romheaders/Makefile ============================================================================== --- trunk/fcode-utils-devel/romheaders/Makefile Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/romheaders/Makefile Mon Apr 26 19:01:01 2010 (r759) @@ -24,7 +24,7 @@ CC ?= gcc STRIP = strip -CFLAGS = -O2 -Wall -W -ansi +CFLAGS = -O2 -Wall -Wextra -ansi INCLUDES = -I../shared SOURCES = romheaders.c ../shared/classcodes.c Modified: trunk/fcode-utils-devel/toke/Makefile ============================================================================== --- trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 19:01:01 2010 (r759) @@ -29,7 +29,7 @@ INCLUDES = -I../shared # Normal flags -CFLAGS = -O2 -Wall -Wextra +CFLAGS = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra LDFLAGS = # Coverage:

Hello Stefan, Am 26.04.2010 um 19:01 schrieb repository service:
Modified: trunk/fcode-utils-devel/toke/Makefile = = = = = = = = ====================================================================== --- trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 19:01:01 2010 (r759) @@ -29,7 +29,7 @@ INCLUDES = -I../shared
# Normal flags -CFLAGS = -O2 -Wall -Wextra +CFLAGS = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra LDFLAGS =
# Coverage:
OpenSolaris' gcc does not understand -Wno-pointer-sign: cc1: error: unrecognized command line option "-Wno-pointer-sign" Could we find another solution please? ;) This works for me for now: Index: toke/Makefile =================================================================== --- toke/Makefile (revision 774) +++ toke/Makefile (working copy) @@ -29,7 +29,7 @@ INCLUDES = -I../shared # Normal flags -CFLAGS = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra +CFLAGS = -O2 -Wall -ansi #-Wno-pointer-sign #-Wextra LDFLAGS = # Coverage: Thanks, Andreas

Am 24.05.2010 um 11:29 schrieb Andreas Färber:
Am 26.04.2010 um 19:01 schrieb repository service:
= ===================================================================== --- trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 17:57:21 2010 (r758) +++ trunk/fcode-utils-devel/toke/Makefile Mon Apr 26 19:01:01 2010 (r759) @@ -29,7 +29,7 @@ INCLUDES = -I../shared
# Normal flags -CFLAGS = -O2 -Wall -Wextra +CFLAGS = -O2 -Wall -ansi -Wno-pointer-sign #-Wextra LDFLAGS =
# Coverage:
OpenSolaris' gcc does not understand -Wno-pointer-sign:
cc1: error: unrecognized command line option "-Wno-pointer-sign"
Worse, -ansi breaks getopt: toke.c: In function `get_args': toke.c:257: warning: implicit declaration of function `getopt' toke.c:268: error: `optarg' undeclared (first use in this function) toke.c:268: error: (Each undefined identifier is reported only once toke.c:268: error: for each function it appears in.) toke.c:337: error: `optind' undeclared (first use in this function) toke.c: In function `main': toke.c:391: error: `optind' undeclared (first use in this function) getopt, optarg, optind are defined in stdlib.h under the following conditions: #if defined(__EXTENSIONS__) || \ (!defined(_STRICT_STDC_) && !defined(__XOPEN_OR_POSIX)) optarg is also defined in getopt.h but not getopt itself. -std=gnu99 does not help, only defining __EXTENSIONS__ or not using - ansi. When defining neither -ansi nor -Wno-pointer-sign in toke/Makefile and detok/Makefile it builds without warnings. Andreas

On 5/24/10 11:29 AM, Andreas Färber wrote:
OpenSolaris' gcc does not understand -Wno-pointer-sign:
cc1: error: unrecognized command line option "-Wno-pointer-sign"
Could we find another solution please? ;)
Wow, which version of OpenSolaris and which version of gcc is this? Your tool chain must be really ancient. Stefan

Am 24.05.2010 um 15:16 schrieb Stefan Reinauer:
On 5/24/10 11:29 AM, Andreas Färber wrote:
OpenSolaris' gcc does not understand -Wno-pointer-sign:
cc1: error: unrecognized command line option "-Wno-pointer-sign"
Could we find another solution please? ;)
Wow, which version of OpenSolaris and which version of gcc is this? Your tool chain must be really ancient.
OpenSolaris 2009.06 snv_111b gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802) Andreas

On 5/24/10 3:24 PM, Andreas Färber wrote:
Am 24.05.2010 um 15:16 schrieb Stefan Reinauer:
On 5/24/10 11:29 AM, Andreas Färber wrote:
OpenSolaris' gcc does not understand -Wno-pointer-sign:
cc1: error: unrecognized command line option "-Wno-pointer-sign"
Could we find another solution please? ;)
Wow, which version of OpenSolaris and which version of gcc is this? Your tool chain must be really ancient.
OpenSolaris 2009.06 snv_111b
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802) Wow... I added a workaround to the toke makefile but you should really update your compiler. It's 6 years old and the 3.x series is no longer maintained by the gcc folks since 2006.
Stefan
participants (3)
-
Andreas Färber
-
repository service
-
Stefan Reinauer