Skip to contentSkip to conversation

use stdio.h

PATCH In review Marius Groeger 2 participants 4 messages Apr 24, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use stdio.h

Hi,

Changelog:

Make dyngen-exec.h include <stdio.h> which is more portable than the local definitions.

Regards,
Marius

Signature · 4 lines
Marius Groeger <[email protected]>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com

Index: dyngen-exec.h
===================================================================
RCS file: /sources/qemu/qemu/dyngen-exec.h,v
retrieving revision 1.26

dyngen-exec.h +1 -3
diff -u -r1.26 dyngen-exec.h
@@ -57,9 +57,7 @@
 #define UINT32_MAX		(4294967295U)
 #define UINT64_MAX		((uint64_t)(18446744073709551615))
 
-typedef struct FILE FILE;
-extern int fprintf(FILE *, const char *, ...);
-extern int printf(const char *, ...);
+#include <stdio.h>
 #undef NULL
 #define NULL 0
 
#1 lore raw
Quoted 6 lines · Marius Groeger

Hi,

Changelog:

Make dyngen-exec.h include <stdio.h> which is more portable than the local definitions.

I believe dyngen-exec.h deliberately doesn't include stdio.h because it conflicts with the local register variables on some hosts.

Paul

#2 lore raw
Quoted 10 lines · Paul Brook
Quoted 6 lines · Marius Groeger

Hi,

Changelog:

Make dyngen-exec.h include <stdio.h> which is more portable than the local definitions.

I believe dyngen-exec.h deliberately doesn't include stdio.h because it conflicts with the local register variables on some hosts.

Ah, I thought there's got to be an explanation... Should be added though to dyngen-exec.h to avoid future patches from wise-guys like myself :-)

Thanks,
Marius

Signature · 4 lines
Marius Groeger <[email protected]>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com
#3 lore raw
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Make dyngen-exec.h include <stdio.h> which is more portable than the local definitions.

I believe dyngen-exec.h deliberately doesn't include stdio.h because it conflicts with the local register variables on some hosts.

Ah, I thought there's got to be an explanation... Should be added though to dyngen-exec.h to avoid future patches from wise-guys like myself :-)

From the top of that file:

/* NOTE: standard headers should be used with special care at this
point because host CPU registers are used as global variables. Some host headers do not allow that. */

Paul