All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the __USE_MINGW_ANSI_STDIO define up to avoid confliction.
@ 2019-04-30 18:13 Cao Jiaxi
  2019-04-30 18:30 ` Eric Blake
  0 siblings, 1 reply; 4+ messages in thread
From: Cao Jiaxi @ 2019-04-30 18:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cao Jiaxi

Signed-off-by: Cao Jiaxi <driver1998@foxmail.com>
---
 include/qemu/osdep.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 303d315c5d..af2b91f0b8 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -85,17 +85,17 @@ extern int daemon(int, int);
 #endif
 #endif
 
+/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
+#ifdef __MINGW32__
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
 #include <stdlib.h>
-
-/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
-#ifdef __MINGW32__
-#define __USE_MINGW_ANSI_STDIO 1
-#endif
 #include <stdio.h>
 
 #include <string.h>
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the __USE_MINGW_ANSI_STDIO define up to avoid confliction.
  2019-04-30 18:13 [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the __USE_MINGW_ANSI_STDIO define up to avoid confliction Cao Jiaxi
@ 2019-04-30 18:30 ` Eric Blake
  2019-05-02 21:05   ` [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the__USE_MINGW_ANSI_STDIO " driver1998
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Blake @ 2019-04-30 18:30 UTC (permalink / raw)
  To: Cao Jiaxi, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

On 4/30/19 1:13 PM, Cao Jiaxi wrote:
> Signed-off-by: Cao Jiaxi <driver1998@foxmail.com>

Your entire series is missing 'In-Reply-To:' and 'References:' headers,
making each message show up as individual new threads rather than
properly threaded to a 0/4 cover letter. You'll want to fix your sending
habits to avoid that problem in future submissions.

It's unusual to use a trailing '.' in the subject line. Also, your
subject is very long; commit message summaries should typically be
around 60-70 characters because 'git log' shows them with further
indentation, where an 80-column terminal window makes it hard to see the
tail at a glance.  Better might be a short subject line explaining the
"what", and then a non-empty commit message explaining the "why",
perhaps looking like:

osdep: Fix mingw compilation regarding stdio formats

I encountered the following compilation error on mingw:
... PASTE SOMETHING HERE

It turns out that __USE_MINGW_ANSI_STDIO must be set before any system
headers are included, not just before <stdio.h>.

Signed-off-by:...

>  
> +/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
> +#ifdef __MINGW32__
> +#define __USE_MINGW_ANSI_STDIO 1
> +#endif
> +
>  #include <stdarg.h>
>  #include <stddef.h>
>  #include <stdbool.h>
>  #include <stdint.h>
>  #include <sys/types.h>
>  #include <stdlib.h>
> -
> -/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
> -#ifdef __MINGW32__
> -#define __USE_MINGW_ANSI_STDIO 1
> -#endif

Question - does it hurt to make the define of __USE_MINGW_ANSI_STDIO
unconditional?  In other words, we're unlikely to break any non-mingw
platform if we drop the #ifdef __MINGW32__ line.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the__USE_MINGW_ANSI_STDIO define up to avoid confliction.
  2019-04-30 18:30 ` Eric Blake
@ 2019-05-02 21:05   ` driver1998
  2019-05-02 21:44     ` Eric Blake
  0 siblings, 1 reply; 4+ messages in thread
From: driver1998 @ 2019-05-02 21:05 UTC (permalink / raw)
  To: Eric Blake, qemu-devel

On 5/1/19 2:30 AM, Eric Blake wrote:
> Your entire series is missing 'In-Reply-To:' and 'References:' headers,
> making each message show up as individual new threads rather than
> properly threaded to a 0/4 cover letter. You'll want to fix your sending
> habits to avoid that problem in future submissions.

I am terribly sorry about that, this is the first time I summit patches, and I am still getting used to the tooling.
Thank you for pointing out the issue though.

> It's unusual to use a trailing '.' in the subject line. Also, your
> subject is very long; commit message summaries should typically be
> around 60-70 characters because 'git log' shows them with further
> indentation, where an 80-column terminal window makes it hard to see the
> tail at a glance.  Better might be a short subject line explaining the
> "what", and then a non-empty commit message explaining the "why"

Thank you for pointing out, I'll update that in the upcoming v3 set.

> Question - does it hurt to make the define of __USE_MINGW_ANSI_STDIO
> unconditional?  In other words, we're unlikely to break any non-mingw
> platform if we drop the #ifdef __MINGW32__ line.

I personally have no idea, so I'll keep it as is.

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

* Re: [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the__USE_MINGW_ANSI_STDIO define up to avoid confliction.
  2019-05-02 21:05   ` [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the__USE_MINGW_ANSI_STDIO " driver1998
@ 2019-05-02 21:44     ` Eric Blake
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2019-05-02 21:44 UTC (permalink / raw)
  To: driver1998, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

On 5/2/19 4:05 PM, driver1998 wrote:
> On 5/1/19 2:30 AM, Eric Blake wrote:
>> Your entire series is missing 'In-Reply-To:' and 'References:' headers,
>> making each message show up as individual new threads rather than
>> properly threaded to a 0/4 cover letter. You'll want to fix your sending
>> habits to avoid that problem in future submissions.
> 
> I am terribly sorry about that, this is the first time I summit patches, and I am still getting used to the tooling.

That's okay, we were all first-timers once; and most human maintainers
try to be more forgiving than automated tools when it comes to working
around first-timer learning curves. There may be other useful hints you
can use at https://wiki.qemu.org/Contribute/SubmitAPatch

> Thank you for pointing out the issue though.
> 
>> It's unusual to use a trailing '.' in the subject line. Also, your
>> subject is very long; commit message summaries should typically be
>> around 60-70 characters because 'git log' shows them with further
>> indentation, where an 80-column terminal window makes it hard to see the
>> tail at a glance.  Better might be a short subject line explaining the
>> "what", and then a non-empty commit message explaining the "why"
> 
> Thank you for pointing out, I'll update that in the upcoming v3 set.
> 
>> Question - does it hurt to make the define of __USE_MINGW_ANSI_STDIO
>> unconditional?  In other words, we're unlikely to break any non-mingw
>> platform if we drop the #ifdef __MINGW32__ line.
> 
> I personally have no idea, so I'll keep it as is.

Fair enough for your patch.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-05-02 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30 18:13 [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the __USE_MINGW_ANSI_STDIO define up to avoid confliction Cao Jiaxi
2019-04-30 18:30 ` Eric Blake
2019-05-02 21:05   ` [Qemu-devel] [PATCH v2 4/4] include/qemu/osdep.h: Move the__USE_MINGW_ANSI_STDIO " driver1998
2019-05-02 21:44     ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.