Skip to content

Remove pre ANSI c89 code

Juan Quintela qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Use proper typedef syntaxhw/serial.c+2 -21 reply
2/7static and inline should came before the type of the functionsgen-icount.h hw/g364fb.c hw/pflash_cfi01.c +5 more+12 -120 replies
3/7Bring two last users of K&R definitions to ANSI c89alpha-dis.c sh4-dis.c+23 -770 replies
4/7gcc wants 1st static and then consthw/g364fb.c target-i386/kvm.c target-microblaze/translate.c+4 -40 replies
5/7__thread should be before real typelinux-user/mmap.c+1 -10 replies
6/7Add -Wold-style-declaration -Wold-style-definition to QEMU_CFLAGSconfigure+1 -04 replies
7/7Remove PARAMS() macroalpha-dis.c dis-asm.h sh4-dis.c+69 -710 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/7] Remove pre ANSI c89 code

Hi

In commemoration of the 20th anniversary of the c89 standard, this brings qemu codebase to c89. How do I know?

Previous to last patch adds to QEMU_CFLAGS:
-Wold-style-declaration -Wold-style-definition

Why?
- typedef abuse for the 1st patch. How that ever worked, I don't know.
- gcc gets picky, and you have to declare functions as:
static inline void f(...)
inline static void f(...)
but
static void inline f(...)
gets warnings. Just move the few functions that have the third format to the 1st one.
- bring alpha-dis.c and sh4-dis.c to ansi c89 function declaration.
- static + const: gcc wants you to use:
static const
and gives a warning for
const static
- same for static + __thread (only 1 occurrence)
- last patch removes PARAMS() from dis-asm.h
last users were alpha-dis.c and sh4-dis.c (do you start to see a pattern here).

Last one is not required, but as qemu is not going to compile in pre-c89 compiler any time soon, it is better to also apply it.

Later, Juan.

Juan Quintela (7):
Use proper typedef syntax
static and inline should came before the type of the functions Bring two last users of K&R definitions to ANSI c89 gcc wants 1st static and then const
__thread should be before real type
Add -Wold-style-declaration -Wold-style-definition to QEMU_CFLAGS Remove PARAMS() macro

 alpha-dis.c                       |  116 ++++++++++++-------------------------
 configure                         |    1 +
 dis-asm.h                         |  102 ++++++++++++++++-----------------
 gen-icount.h                      |    2 +-
 hw/g364fb.c                       |    4 +-
 hw/pflash_cfi01.c                 |    2 +-
 hw/serial.c                       |    4 +-
 hw/sh7750.c                       |    2 +-
 hw/usb-bt.c                       |    2 +-
 hw/xen_blkif.h                    |    4 +-
 linux-user/arm/nwfpe/fpa11_cprt.c |    2 +-
 linux-user/mmap.c                 |    2 +-
 sh4-dis.c                         |   32 +++-------
 target-i386/kvm.c                 |    2 +-
 target-microblaze/translate.c     |    4 +-
 target-ppc/translate.c            |    8 +-
 16 files changed, 116 insertions(+), 173 deletions(-)