summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMichael Brown2012-04-10 20:38:54 +0200
committerMichael Brown2012-04-10 20:38:54 +0200
commit196751ce95fa6b6566a5b336193681fad3581fd1 (patch)
tree5f4c47b8b7099513f34f6219abccb437b8656cb9 /src/util
parent[igbvf] Add i350 virtual function support (diff)
downloadipxe-196751ce95fa6b6566a5b336193681fad3581fd1.tar.gz
ipxe-196751ce95fa6b6566a5b336193681fad3581fd1.tar.xz
ipxe-196751ce95fa6b6566a5b336193681fad3581fd1.zip
[build] Enable warnings when building utilities
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/efirom.c18
-rw-r--r--src/util/einfo.c13
-rw-r--r--src/util/elf2efi.c7
-rw-r--r--src/util/iccfix.c3
-rw-r--r--src/util/nrv2b.c5
-rw-r--r--src/util/zbin.c7
6 files changed, 23 insertions, 30 deletions
diff --git a/src/util/efirom.c b/src/util/efirom.c
index d0bdace6..a65abfee 100644
--- a/src/util/efirom.c
+++ b/src/util/efirom.c
@@ -57,18 +57,6 @@ static void * xmalloc ( size_t len ) {
}
/**
- * Get file size
- *
- * @v file File
- * @v len File size
- */
-static size_t file_size ( FILE *file ) {
- ssize_t len;
-
- return len;
-}
-
-/**
* Read information from PE headers
*
* @v pe PE file
@@ -239,15 +227,15 @@ static int parse_options ( const int argc, char **argv,
}
int main ( int argc, char **argv ) {
- struct options opts = {
- };
- unsigned int infile_index;
+ struct options opts;
+ int infile_index;
const char *infile_name;
const char *outfile_name;
FILE *infile;
FILE *outfile;
/* Parse command-line arguments */
+ memset ( &opts, 0, sizeof ( opts ) );
infile_index = parse_options ( argc, argv, &opts );
if ( argc != ( infile_index + 2 ) ) {
print_help ( argv[0] );
diff --git a/src/util/einfo.c b/src/util/einfo.c
index 06736f21..15f920d0 100644
--- a/src/util/einfo.c
+++ b/src/util/einfo.c
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -49,7 +50,8 @@ struct einfo {
* @v infile Filename
* @v opts Command-line options
*/
-static void einfo ( const char *infile, struct options *opts ) {
+static void einfo ( const char *infile,
+ struct options *opts __attribute__ (( unused )) ) {
int fd;
struct stat stat;
size_t len;
@@ -85,9 +87,9 @@ static void einfo ( const char *infile, struct options *opts ) {
for ( einfo = start ; ( ( void * ) einfo ) < ( start + len ) ;
einfo = ( ( ( void * ) einfo ) + einfo->size ) ) {
printf ( "%08x\t%s\t%d\t%s\n", einfo->error,
- ( ( ( void * ) einfo ) + einfo->file ),
+ ( ( ( char * ) einfo ) + einfo->file ),
einfo->line,
- ( ( ( void * ) einfo ) + einfo->desc ) );
+ ( ( ( char * ) einfo ) + einfo->desc ) );
}
}
@@ -115,8 +117,7 @@ static void print_help ( const char *program_name ) {
* @v opts Options structure to populate
*/
static int parse_options ( const int argc, char **argv,
- struct options *opts ) {
- char *end;
+ struct options *opts __attribute__ (( unused )) ) {
int c;
while (1) {
@@ -147,7 +148,7 @@ static int parse_options ( const int argc, char **argv,
int main ( int argc, char **argv ) {
struct options opts = {
};
- unsigned int infile_index;
+ int infile_index;
const char *infile;
/* Parse command-line arguments */
diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c
index e6629296..c8df22e1 100644
--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -459,7 +459,8 @@ static struct pe_section * process_section ( bfd *bfd,
* @v rel Relocation entry
* @v pe_reltab PE relocation table to fill in
*/
-static void process_reloc ( bfd *bfd, asection *section, arelent *rel,
+static void process_reloc ( bfd *bfd __attribute__ (( unused )),
+ asection *section, arelent *rel,
struct pe_relocs **pe_reltab ) {
reloc_howto_type *howto = rel->howto;
asymbol *sym = *(rel->sym_ptr_ptr);
@@ -637,7 +638,7 @@ static void write_pe_file ( struct pe_header *pe_header,
for ( section = pe_sections ; section ; section = section->next ) {
if ( fseek ( pe, section->hdr.PointerToRawData,
SEEK_SET ) != 0 ) {
- eprintf ( "Could not seek to %lx: %s\n",
+ eprintf ( "Could not seek to %x: %s\n",
section->hdr.PointerToRawData,
strerror ( errno ) );
exit ( 1 );
@@ -786,7 +787,7 @@ int main ( int argc, char **argv ) {
struct options opts = {
.subsystem = EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION,
};
- unsigned int infile_index;
+ int infile_index;
const char *infile;
const char *outfile;
diff --git a/src/util/iccfix.c b/src/util/iccfix.c
index 8b555c54..528bf4b2 100644
--- a/src/util/iccfix.c
+++ b/src/util/iccfix.c
@@ -2,6 +2,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -49,7 +50,7 @@ static int ICCFIX ( void *elf ) {
( align >= ICC_ALIGN_HACK_FACTOR ) ) {
new_align = ( align / ICC_ALIGN_HACK_FACTOR );
shdr->sh_addralign = new_align;
- dprintf ( "Section \"%s\": alignment %d->%d\n",
+ dprintf ( "Section \"%s\": alignment %ld->%ld\n",
name, align, new_align );
}
}
diff --git a/src/util/nrv2b.c b/src/util/nrv2b.c
index 6bac4cdd..cbb94c0e 100644
--- a/src/util/nrv2b.c
+++ b/src/util/nrv2b.c
@@ -77,7 +77,7 @@ static __inline__ void Error(char *message)
/* These will be a complete waste of time on a lo-endian */
/* system, but it only gets done once so WTF. */
-static unsigned long i86ul_to_host(unsigned long ul)
+static unsigned long __attribute__ (( unused )) i86ul_to_host(unsigned long ul)
{
unsigned long res = 0;
int i;
@@ -375,7 +375,6 @@ static
int swd_init(struct ucl_swd *s, const uint8_t *dict, unsigned int dict_len)
{
unsigned int i = 0;
- int c = 0;
if (s->n == 0)
s->n = N;
@@ -439,7 +438,7 @@ static
void swd_exit(struct ucl_swd *s)
{
/* unused s */
-
+ ( void ) s;
}
#define swd_pos2off(s,pos) \
diff --git a/src/util/zbin.c b/src/util/zbin.c
index f0df5ea0..a9195164 100644
--- a/src/util/zbin.c
+++ b/src/util/zbin.c
@@ -218,7 +218,8 @@ static int process_zinfo_pack ( struct input_file *input,
return 0;
}
-static int process_zinfo_payl ( struct input_file *input,
+static int process_zinfo_payl ( struct input_file *input
+ __attribute__ (( unused )),
struct output_file *output,
union zinfo_record *zinfo ) {
struct zinfo_payload *payload = &zinfo->payload;
@@ -229,9 +230,11 @@ static int process_zinfo_payl ( struct input_file *input,
if ( DEBUG ) {
fprintf ( stderr, "PAYL at %#zx\n", output->hdr_len );
}
+ return 0;
}
-static int process_zinfo_add ( struct input_file *input,
+static int process_zinfo_add ( struct input_file *input
+ __attribute__ (( unused )),
struct output_file *output,
size_t len,
struct zinfo_add *add,