qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Build fixes
@ 2009-09-29 23:10 Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 1/3] slirp: It needs to use QEMU_CFLAGS not CFLAGS Juan Quintela
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Juan Quintela @ 2009-09-29 23:10 UTC (permalink / raw)
  To: qemu-devel

This series contains all build fixes on my queue:
- fix slirp to compile with a custom CFLAGS
- Add -Wold-style-* flags only if compiler understand them
- Fix last users of TRUE/FALSE.  Now we can include <stdbool.h> anywhere.

Later, Juan.

Juan Quintela (3):
  slirp: It needs to use QEMU_CFLAGS not CFLAGS
  Add -Wold-style-* flags
  bdf: Remove last users of FALSE/TRUE

 arm-dis.c        |   60 ++++++++++++++++++++++++++---------------------------
 configure        |   12 +++++++++-
 cris-dis.c       |   18 +++++++---------
 dis-asm.h        |    4 +-
 microblaze-dis.c |    2 +-
 5 files changed, 51 insertions(+), 45 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/3] slirp: It needs to use QEMU_CFLAGS not CFLAGS
  2009-09-29 23:10 [Qemu-devel] [PATCH 0/3] Build fixes Juan Quintela
@ 2009-09-29 23:10 ` Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 2/3] Add -Wold-style-* flags Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 3/3] bdf: Remove last users of FALSE/TRUE Juan Quintela
  2 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2009-09-29 23:10 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index fb5b6bb..8b0db7e 100755
--- a/configure
+++ b/configure
@@ -1827,7 +1827,7 @@ if test $profiler = "yes" ; then
 fi
 if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=y" >> $config_host_mak
-  CFLAGS="-I\$(SRC_PATH)/slirp $CFLAGS"
+  QEMU_CFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
 fi
 if test "$vde" = "yes" ; then
   echo "CONFIG_VDE=y" >> $config_host_mak
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/3] Add -Wold-style-* flags
  2009-09-29 23:10 [Qemu-devel] [PATCH 0/3] Build fixes Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 1/3] slirp: It needs to use QEMU_CFLAGS not CFLAGS Juan Quintela
@ 2009-09-29 23:10 ` Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 3/3] bdf: Remove last users of FALSE/TRUE Juan Quintela
  2 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2009-09-29 23:10 UTC (permalink / raw)
  To: qemu-devel

This time, I add them in configure only if target compiler supports it

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 8b0db7e..81bcc27 100755
--- a/configure
+++ b/configure
@@ -1653,6 +1653,16 @@ QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS"
 QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS"
 LDFLAGS="-g $LDFLAGS"

+gcc_flags="-Wold-style-declaration -Wold-style-definition"
+cat > $TMPC << EOF
+int main(void) { }
+EOF
+for flag in $gcc_flags; do
+    if compile_prog "$QEMU_CFLAGS" "$flag" ; then
+	QEMU_CFLAGS="$flag $QEMU_CFLAGS"
+    fi
+done
+
 # Consult white-list to determine whether to enable werror
 # by default.  Only enable by default for git builds
 if test -z "$werror" ; then
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 3/3] bdf: Remove last users of FALSE/TRUE
  2009-09-29 23:10 [Qemu-devel] [PATCH 0/3] Build fixes Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 1/3] slirp: It needs to use QEMU_CFLAGS not CFLAGS Juan Quintela
  2009-09-29 23:10 ` [Qemu-devel] [PATCH 2/3] Add -Wold-style-* flags Juan Quintela
@ 2009-09-29 23:10 ` Juan Quintela
  2 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2009-09-29 23:10 UTC (permalink / raw)
  To: qemu-devel

This brings bfd_boolean to the wonderful world of <stdbool.h>, it is needed
because it defines bdf_boolean as an enum with values true and false,
and some architectures use TRUE, FALSE and give problems when you try to use
<stdbool.h>

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 arm-dis.c        |   60 ++++++++++++++++++++++++++---------------------------
 cris-dis.c       |   18 +++++++---------
 dis-asm.h        |    4 +-
 microblaze-dis.c |    2 +-
 4 files changed, 40 insertions(+), 44 deletions(-)

diff --git a/arm-dis.c b/arm-dis.c
index 5c736c1..2c67d8f 100644
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -23,8 +23,6 @@
    for things we don't care about.  */

 #include "dis-asm.h"
-#define FALSE 0
-#define TRUE (!FALSE)
 #define ATTRIBUTE_UNUSED __attribute__((unused))
 #define ISSPACE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')

@@ -1531,7 +1529,7 @@ static unsigned int regname_selected = 1;
 #define NUM_ARM_REGNAMES  NUM_ELEM (regnames)
 #define arm_regnames      regnames[regname_selected].reg_names

-static bfd_boolean force_thumb = FALSE;
+static bfd_boolean force_thumb = false;

 /* Current IT instruction state.  This contains the same state as the IT
    bits in the CPSR.  */
@@ -1628,7 +1626,7 @@ arm_decode_shift (long given, fprintf_ftype func, void *stream,
 }

 /* Print one coprocessor instruction on INFO->STREAM.
-   Return TRUE if the instuction matched, FALSE if this is not a
+   Return true if the instuction matched, false if this is not a
    recognised coprocessor instruction.  */

 static bfd_boolean
@@ -2121,10 +2119,10 @@ print_insn_coprocessor (bfd_vma pc, struct disassemble_info *info, long given,
 	      else
 		func (stream, "%c", *c);
 	    }
-	  return TRUE;
+	  return true;
 	}
     }
-  return FALSE;
+  return false;
 }

 static void
@@ -2218,7 +2216,7 @@ print_arm_address (bfd_vma pc, struct disassemble_info *info, long given)
 }

 /* Print one neon instruction on INFO->STREAM.
-   Return TRUE if the instuction matched, FALSE if this is not a
+   Return true if the instuction matched, false if this is not a
    recognised neon instruction.  */

 static bfd_boolean
@@ -2244,7 +2242,7 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
       else if ((given & 0xff000000) == 0xf9000000)
 	given ^= 0xf9000000 ^ 0xf4000000;
       else
-	return FALSE;
+	return false;
     }

   for (insn = neon_opcodes; insn->assembler; insn++)
@@ -2334,34 +2332,34 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
                             {
                               int amask = (1 << size) - 1;
                               if ((idx_align & (1 << size)) != 0)
-                                return FALSE;
+                                return false;
                               if (size > 0)
                                 {
                                   if ((idx_align & amask) == amask)
                                     align = 8 << size;
                                   else if ((idx_align & amask) != 0)
-                                    return FALSE;
+                                    return false;
                                 }
                               }
                             break;

                           case 2:
                             if (size == 2 && (idx_align & 2) != 0)
-                              return FALSE;
+                              return false;
                             align = (idx_align & 1) ? 16 << size : 0;
                             break;

                           case 3:
                             if ((size == 2 && (idx_align & 3) != 0)
                                 || (idx_align & 1) != 0)
-                              return FALSE;
+                              return false;
                             break;

                           case 4:
                             if (size == 2)
                               {
                                 if ((idx_align & 3) == 3)
-                                  return FALSE;
+                                  return false;
                                 align = (idx_align & 3) * 64;
                               }
                             else
@@ -2670,10 +2668,10 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
 	      else
 		func (stream, "%c", *c);
 	    }
-	  return TRUE;
+	  return true;
 	}
     }
-  return FALSE;
+  return false;
 }

 /* Print one ARM instruction from PC on INFO->STREAM.  */
@@ -2685,10 +2683,10 @@ print_insn_arm_internal (bfd_vma pc, struct disassemble_info *info, long given)
   void *stream = info->stream;
   fprintf_ftype func = info->fprintf_func;

-  if (print_insn_coprocessor (pc, info, given, FALSE))
+  if (print_insn_coprocessor (pc, info, given, false))
     return;

-  if (print_insn_neon (info, given, FALSE))
+  if (print_insn_neon (info, given, false))
     return;

   for (insn = arm_opcodes; insn->assembler; insn++)
@@ -3321,10 +3319,10 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
   void *stream = info->stream;
   fprintf_ftype func = info->fprintf_func;

-  if (print_insn_coprocessor (pc, info, given, TRUE))
+  if (print_insn_coprocessor (pc, info, given, true))
     return;

-  if (print_insn_neon (info, given, TRUE))
+  if (print_insn_neon (info, given, true))
     return;

   for (insn = thumb32_opcodes; insn->assembler; insn++)
@@ -3459,7 +3457,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
 		  unsigned int op  = (given & 0x00000f00) >> 8;
 		  unsigned int i12 = (given & 0x00000fff);
 		  unsigned int i8  = (given & 0x000000ff);
-		  bfd_boolean writeback = FALSE, postind = FALSE;
+		  bfd_boolean writeback = false, postind = false;
 		  int offset = 0;

 		  func (stream, "[%s", arm_regnames[Rn]);
@@ -3489,22 +3487,22 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)

 		    case 0xF:  /* 8-bit + preindex with wb */
 		      offset = i8;
-		      writeback = TRUE;
+		      writeback = true;
 		      break;

 		    case 0xD:  /* 8-bit - preindex with wb */
 		      offset = -i8;
-		      writeback = TRUE;
+		      writeback = true;
 		      break;

 		    case 0xB:  /* 8-bit + postindex */
 		      offset = i8;
-		      postind = TRUE;
+		      postind = true;
 		      break;

 		    case 0x9:  /* 8-bit - postindex */
 		      offset = -i8;
-		      postind = TRUE;
+		      postind = true;
 		      break;

 		    default:
@@ -3877,12 +3875,12 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
   unsigned char b[4];
   long		given;
   int           status;
-  int           is_thumb = FALSE;
-  int           is_data = FALSE;
+  int           is_thumb = false;
+  int           is_data = false;
   unsigned int	size = 4;
   void	 	(*printer) (bfd_vma, struct disassemble_info *, long);
 #if 0
-  bfd_boolean   found = FALSE;
+  bfd_boolean   found = false;

   if (info->disassembler_options)
     {
@@ -3905,7 +3903,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
       if (pc <= last_mapping_addr)
 	last_mapping_sym = -1;
       is_thumb = (last_type == MAP_THUMB);
-      found = FALSE;
+      found = false;
       /* Start scanning at the start of the function, or wherever
 	 we finished last time.  */
       n = info->symtab_pos + 1;
@@ -3923,7 +3921,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
 	      && get_sym_code_type (info, n, &type))
 	    {
 	      last_sym = n;
-	      found = TRUE;
+	      found = true;
 	    }
 	}

@@ -3940,7 +3938,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
 	      if (get_sym_code_type (info, n, &type))
 		{
 		  last_sym = n;
-		  found = TRUE;
+		  found = true;
 		  break;
 		}
 	    }
@@ -4012,7 +4010,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
 #endif

   if (force_thumb)
-    is_thumb = TRUE;
+    is_thumb = true;

   info->bytes_per_line = 4;

diff --git a/cris-dis.c b/cris-dis.c
index f6932a0..455ba8a 100644
--- a/cris-dis.c
+++ b/cris-dis.c
@@ -26,8 +26,6 @@

 void *qemu_malloc(size_t len); /* can't include qemu-common.h here */

-#define FALSE 0
-#define TRUE 1
 #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)

 /* cris-opc.c -- Table of opcodes for the CRIS processor.
@@ -1320,7 +1318,7 @@ cris_parse_disassembler_options (disassemble_info *info,
   info->private_data = calloc (1, sizeof (struct cris_disasm_data));
   disdata = (struct cris_disasm_data *) info->private_data;
   if (disdata == NULL)
-    return FALSE;
+    return false;

   /* Default true.  */
   disdata->trace_case
@@ -1328,7 +1326,7 @@ cris_parse_disassembler_options (disassemble_info *info,
        || (strcmp (info->disassembler_options, "nocase") != 0));

   disdata->distype = distype;
-  return TRUE;
+  return true;
 }

 static const struct cris_spec_reg *
@@ -2779,7 +2777,7 @@ print_insn_cris_with_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v0_v10))
     return -1;
-  return print_insn_cris_generic (vma, info, TRUE);
+  return print_insn_cris_generic (vma, info, true);
 }
 #endif
 /* Disassemble, prefixing register names with `$'.  CRIS v32.  */
@@ -2791,7 +2789,7 @@ print_insn_crisv32_with_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v32))
     return -1;
-  return print_insn_cris_generic (vma, info, TRUE);
+  return print_insn_cris_generic (vma, info, true);
 }

 #if 0
@@ -2805,7 +2803,7 @@ print_insn_crisv10_v32_with_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))
     return -1;
-  return print_insn_cris_generic (vma, info, TRUE);
+  return print_insn_cris_generic (vma, info, true);
 }

 /* Disassemble, no prefixes on register names.  CRIS v0..v10.  */
@@ -2817,7 +2815,7 @@ print_insn_cris_without_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v0_v10))
     return -1;
-  return print_insn_cris_generic (vma, info, FALSE);
+  return print_insn_cris_generic (vma, info, false);
 }

 /* Disassemble, no prefixes on register names.  CRIS v32.  */
@@ -2829,7 +2827,7 @@ print_insn_crisv32_without_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_v32))
     return -1;
-  return print_insn_cris_generic (vma, info, FALSE);
+  return print_insn_cris_generic (vma, info, false);
 }

 /* Disassemble, no prefixes on register names.
@@ -2842,7 +2840,7 @@ print_insn_crisv10_v32_without_register_prefix (bfd_vma vma,
   if (info->private_data == NULL
       && !cris_parse_disassembler_options (info, cris_dis_common_v10_v32))
     return -1;
-  return print_insn_cris_generic (vma, info, FALSE);
+  return print_insn_cris_generic (vma, info, false);
 }
 #endif

diff --git a/dis-asm.h b/dis-asm.h
index 1d8f4bd..5f6f06c 100644
--- a/dis-asm.h
+++ b/dis-asm.h
@@ -10,6 +10,7 @@
 #define DIS_ASM_H

 #include <stdlib.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
@@ -471,7 +472,6 @@ bfd_vma bfd_getl32 (const bfd_byte *addr);
 bfd_vma bfd_getb32 (const bfd_byte *addr);
 bfd_vma bfd_getl16 (const bfd_byte *addr);
 bfd_vma bfd_getb16 (const bfd_byte *addr);
-typedef enum bfd_boolean {false, true} boolean;
-typedef boolean bfd_boolean;
+typedef bool bfd_boolean;

 #endif /* ! defined (DIS_ASM_H) */
diff --git a/microblaze-dis.c b/microblaze-dis.c
index 6144334..016b25e 100644
--- a/microblaze-dis.c
+++ b/microblaze-dis.c
@@ -543,7 +543,7 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
   unsigned long       inst, prev_inst;
   struct op_code_struct * op, *pop;
   int                 immval = 0;
-  boolean             immfound = false;
+  bfd_boolean         immfound = false;
   static bfd_vma prev_insn_addr = -1; /*init the prev insn addr */
   static int     prev_insn_vma = -1;  /*init the prev insn vma */
   int            curr_insn_vma = info->buffer_vma;
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 0/3] Build fixes
@ 2011-07-04 21:59 Raghavendra D Prabhu
  0 siblings, 0 replies; 5+ messages in thread
From: Raghavendra D Prabhu @ 2011-07-04 21:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Raghavendra D Prabhu, kvm

Hi,
    With default configure, the qemu-kvm client build was failing for me
    since Werror is enabled by default in configure.
    Deprecations (gnutls), gcc signed-overflow optimization
    (Werror=strict-overflows) and few unused-but-set variables were
    causing it. I have attached the patches after applying which, I got
    no further errors.


Raghavendra D Prabhu (3):
  Avoid the use of deprecated gnutls gnutls_*_set_priority functions.
  Add fno-strict-overflow
  Avoid Wunsed-but-set warnings (or errors in case of Werror)

 Makefile.hw            |    2 +-
 hw/device-assignment.c |    6 +++---
 simpletrace.c          |    2 +-
 ui/vnc-tls.c           |   20 +-------------------
 xen-mapcache.c         |    7 ++-----
 5 files changed, 8 insertions(+), 29 deletions(-)

-- 
1.7.6

--------------------------
Raghavendra Prabhu
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
www: wnohang.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-04 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29 23:10 [Qemu-devel] [PATCH 0/3] Build fixes Juan Quintela
2009-09-29 23:10 ` [Qemu-devel] [PATCH 1/3] slirp: It needs to use QEMU_CFLAGS not CFLAGS Juan Quintela
2009-09-29 23:10 ` [Qemu-devel] [PATCH 2/3] Add -Wold-style-* flags Juan Quintela
2009-09-29 23:10 ` [Qemu-devel] [PATCH 3/3] bdf: Remove last users of FALSE/TRUE Juan Quintela
  -- strict thread matches above, loose matches on Subject: below --
2011-07-04 21:59 [Qemu-devel] [PATCH 0/3] Build fixes Raghavendra D Prabhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).