* [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
@ 2017-04-10 6:06 Nikunj A Dadhania
2017-04-10 7:56 ` Alex Bennée
2017-04-10 17:26 ` Richard Henderson
0 siblings, 2 replies; 8+ messages in thread
From: Nikunj A Dadhania @ 2017-04-10 6:06 UTC (permalink / raw)
To: qemu-devel, peter.maydell, rth
Cc: pbonzini, crosthwaite.peter, david, alex.bennee, nikunj
While the configure script generates TARGET_SUPPORTS_MTTCG define, one
of the define is cpus.c is checking wrong name: TARGET_SUPPORT_MTTCG
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 68fdbc4..58d90aa 100644
--- a/cpus.c
+++ b/cpus.c
@@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
} else if (use_icount) {
error_setg(errp, "No MTTCG when icount is enabled");
} else {
-#ifndef TARGET_SUPPORT_MTTCG
+#ifndef TARGET_SUPPORTS_MTTCG
error_report("Guest not yet converted to MTTCG - "
"you may get unexpected results");
#endif
--
2.9.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 6:06 [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name Nikunj A Dadhania
@ 2017-04-10 7:56 ` Alex Bennée
2017-04-10 17:26 ` Richard Henderson
1 sibling, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2017-04-10 7:56 UTC (permalink / raw)
To: Nikunj A Dadhania
Cc: qemu-devel, peter.maydell, rth, pbonzini, crosthwaite.peter,
david
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> writes:
> While the configure script generates TARGET_SUPPORTS_MTTCG define, one
> of the define is cpus.c is checking wrong name: TARGET_SUPPORT_MTTCG
>
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> ---
> cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index 68fdbc4..58d90aa 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
> } else if (use_icount) {
> error_setg(errp, "No MTTCG when icount is enabled");
> } else {
> -#ifndef TARGET_SUPPORT_MTTCG
> +#ifndef TARGET_SUPPORTS_MTTCG
> error_report("Guest not yet converted to MTTCG - "
> "you may get unexpected results");
> #endif
Opps that's embarrassing.
Applied to my tree, I'll be sending a pullreq today
--
Alex Bennée
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 6:06 [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name Nikunj A Dadhania
2017-04-10 7:56 ` Alex Bennée
@ 2017-04-10 17:26 ` Richard Henderson
2017-04-10 17:29 ` Peter Maydell
1 sibling, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2017-04-10 17:26 UTC (permalink / raw)
To: Nikunj A Dadhania, qemu-devel, peter.maydell
Cc: pbonzini, crosthwaite.peter, david, alex.bennee
On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
> While the configure script generates TARGET_SUPPORTS_MTTCG define, one
> of the define is cpus.c is checking wrong name: TARGET_SUPPORT_MTTCG
>
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
> ---
> cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index 68fdbc4..58d90aa 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
> } else if (use_icount) {
> error_setg(errp, "No MTTCG when icount is enabled");
> } else {
> -#ifndef TARGET_SUPPORT_MTTCG
> +#ifndef TARGET_SUPPORTS_MTTCG
This sort of thing is why glibc moved to using -Wundef.
It would be a huge amount of work to convert our existing sources, but it would
probably pay off in the long run.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 17:26 ` Richard Henderson
@ 2017-04-10 17:29 ` Peter Maydell
2017-04-10 17:31 ` Richard Henderson
2017-04-10 17:44 ` Greg Kurz
0 siblings, 2 replies; 8+ messages in thread
From: Peter Maydell @ 2017-04-10 17:29 UTC (permalink / raw)
To: Richard Henderson
Cc: Nikunj A Dadhania, QEMU Developers, Paolo Bonzini,
Peter Crosthwaite, David Gibson, Alex Bennée
On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:
> On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
>> } else if (use_icount) {
>> error_setg(errp, "No MTTCG when icount is enabled");
>> } else {
>> -#ifndef TARGET_SUPPORT_MTTCG
>> +#ifndef TARGET_SUPPORTS_MTTCG
>
>
> This sort of thing is why glibc moved to using -Wundef.
>
> It would be a huge amount of work to convert our existing sources, but it
> would probably pay off in the long run.
We already build with -Wundef...
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 17:29 ` Peter Maydell
@ 2017-04-10 17:31 ` Richard Henderson
2017-04-10 17:44 ` Greg Kurz
1 sibling, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2017-04-10 17:31 UTC (permalink / raw)
To: Peter Maydell
Cc: Nikunj A Dadhania, QEMU Developers, Paolo Bonzini,
Peter Crosthwaite, David Gibson, Alex Bennée
On 04/10/2017 10:29 AM, Peter Maydell wrote:
> On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:
>> On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
>>> --- a/cpus.c
>>> +++ b/cpus.c
>>> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
>>> } else if (use_icount) {
>>> error_setg(errp, "No MTTCG when icount is enabled");
>>> } else {
>>> -#ifndef TARGET_SUPPORT_MTTCG
>>> +#ifndef TARGET_SUPPORTS_MTTCG
>>
>>
>> This sort of thing is why glibc moved to using -Wundef.
>>
>> It would be a huge amount of work to convert our existing sources, but it
>> would probably pay off in the long run.
>
> We already build with -Wundef...
Ah, but then you also have to stop using #ifdef and #ifndef, and use only #if.
Thus my incomplete comment above about conversion.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 17:29 ` Peter Maydell
2017-04-10 17:31 ` Richard Henderson
@ 2017-04-10 17:44 ` Greg Kurz
2017-04-10 17:49 ` Richard Henderson
1 sibling, 1 reply; 8+ messages in thread
From: Greg Kurz @ 2017-04-10 17:44 UTC (permalink / raw)
To: Peter Maydell
Cc: Richard Henderson, Nikunj A Dadhania, Peter Crosthwaite,
QEMU Developers, Paolo Bonzini, Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
On Mon, 10 Apr 2017 18:29:57 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:
> On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:
> > On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
> >> --- a/cpus.c
> >> +++ b/cpus.c
> >> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
> >> } else if (use_icount) {
> >> error_setg(errp, "No MTTCG when icount is enabled");
> >> } else {
> >> -#ifndef TARGET_SUPPORT_MTTCG
> >> +#ifndef TARGET_SUPPORTS_MTTCG
> >
> >
> > This sort of thing is why glibc moved to using -Wundef.
> >
> > It would be a huge amount of work to convert our existing sources, but it
> > would probably pay off in the long run.
>
> We already build with -Wundef...
>
From the gcc info page:
'-Wundef'
Warn if an undefined identifier is evaluated in an '#if' directive.
and BTW, isn't the purpose of #ifndef precisely to detect that the
identifier is undefined ?
> thanks
> -- PMM
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 17:44 ` Greg Kurz
@ 2017-04-10 17:49 ` Richard Henderson
2017-04-10 22:13 ` Greg Kurz
0 siblings, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2017-04-10 17:49 UTC (permalink / raw)
To: Greg Kurz, Peter Maydell
Cc: Nikunj A Dadhania, Peter Crosthwaite, QEMU Developers,
Paolo Bonzini, Alex Bennée, David Gibson
On 04/10/2017 10:44 AM, Greg Kurz wrote:
> On Mon, 10 Apr 2017 18:29:57 +0100
> Peter Maydell <peter.maydell@linaro.org> wrote:
>
>> On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:
>>> On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
>>>> --- a/cpus.c
>>>> +++ b/cpus.c
>>>> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
>>>> } else if (use_icount) {
>>>> error_setg(errp, "No MTTCG when icount is enabled");
>>>> } else {
>>>> -#ifndef TARGET_SUPPORT_MTTCG
>>>> +#ifndef TARGET_SUPPORTS_MTTCG
>>>
>>>
>>> This sort of thing is why glibc moved to using -Wundef.
>>>
>>> It would be a huge amount of work to convert our existing sources, but it
>>> would probably pay off in the long run.
>>
>> We already build with -Wundef...
>>
>
> From the gcc info page:
>
> '-Wundef'
> Warn if an undefined identifier is evaluated in an '#if' directive.
>
> and BTW, isn't the purpose of #ifndef precisely to detect that the
> identifier is undefined ?
Yes, but it also has the typo problem above, whereas
#if !TARGET_SUPPORTS_MTTCG
plus -Wundef would have caught that error.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name
2017-04-10 17:49 ` Richard Henderson
@ 2017-04-10 22:13 ` Greg Kurz
0 siblings, 0 replies; 8+ messages in thread
From: Greg Kurz @ 2017-04-10 22:13 UTC (permalink / raw)
To: Richard Henderson
Cc: Peter Maydell, Nikunj A Dadhania, Peter Crosthwaite,
QEMU Developers, Paolo Bonzini, Alex Bennée, David Gibson
[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]
On Mon, 10 Apr 2017 10:49:12 -0700
Richard Henderson <rth@twiddle.net> wrote:
> On 04/10/2017 10:44 AM, Greg Kurz wrote:
> > On Mon, 10 Apr 2017 18:29:57 +0100
> > Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> >> On 10 April 2017 at 18:26, Richard Henderson <rth@twiddle.net> wrote:
> >>> On 04/09/2017 11:06 PM, Nikunj A Dadhania wrote:
> >>>> --- a/cpus.c
> >>>> +++ b/cpus.c
> >>>> @@ -202,7 +202,7 @@ void qemu_tcg_configure(QemuOpts *opts, Error **errp)
> >>>> } else if (use_icount) {
> >>>> error_setg(errp, "No MTTCG when icount is enabled");
> >>>> } else {
> >>>> -#ifndef TARGET_SUPPORT_MTTCG
> >>>> +#ifndef TARGET_SUPPORTS_MTTCG
> >>>
> >>>
> >>> This sort of thing is why glibc moved to using -Wundef.
> >>>
> >>> It would be a huge amount of work to convert our existing sources, but it
> >>> would probably pay off in the long run.
> >>
> >> We already build with -Wundef...
> >>
> >
> > From the gcc info page:
> >
> > '-Wundef'
> > Warn if an undefined identifier is evaluated in an '#if' directive.
> >
> > and BTW, isn't the purpose of #ifndef precisely to detect that the
> > identifier is undefined ?
>
> Yes, but it also has the typo problem above, whereas
>
> #if !TARGET_SUPPORTS_MTTCG
>
> plus -Wundef would have caught that error.
>
Turning such #ifdef/#ifndef to #if/#if ! would indeed make sense, but
we'd still have to be careful that every new addition follows the rule.
>
> r~
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-04-10 22:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-10 6:06 [Qemu-devel] [PATCH fix for-2.9] cpus: fix wrong define name Nikunj A Dadhania
2017-04-10 7:56 ` Alex Bennée
2017-04-10 17:26 ` Richard Henderson
2017-04-10 17:29 ` Peter Maydell
2017-04-10 17:31 ` Richard Henderson
2017-04-10 17:44 ` Greg Kurz
2017-04-10 17:49 ` Richard Henderson
2017-04-10 22:13 ` Greg Kurz
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).