All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott D Phillips <scott.d.phillips@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] tools/aubdump: Fix ISO C90 forbids mixed declarations and code warning
Date: Tue, 10 Apr 2018 07:57:19 -0700	[thread overview]
Message-ID: <8737039kj4.fsf@intel.com> (raw)
In-Reply-To: <d54d4c59-5535-02bc-c55d-df52c0f0d6a1@linux.intel.com>

Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> writes:

> On 09/04/2018 18:03, Scott D Phillips wrote:
>> Tvrtko Ursulin <tursulin@ursulin.net> writes:
>> 
>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>
>>> Back to a clean build with no warnings, at least for me.
>> 
>> Why c90? If that's the language we mean to target then we should
>> probably add it to the build system so people with gcc 5.1 and later
>> will see the warnings too. fwiw, my build with clang 6 gives a couple
>> dozen warnings.
>
> I am building under Ubuntu 17.10 with GCC 7.2.0. Normal configure && 
> make, and get this warning. And since I can't spot that IGT is setting 
> the C standard explicitly, I guess that's the default.

Ah, turns out it's not -std=c90, but an explicit
-Wdeclaration-after-statement that we pick up through
XORG_DEFAULT_OPTIONS. Clang seems to emit that warning only if it's in
c90 mode, which is why I didn't see it. So I'll say

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>

> This one is the only warning on my build btw.
>
> Regards,
>
> Tvrtko
>
>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>>> Cc: Scott D Phillips <scott.d.phillips@intel.com>
>>> ---
>>>   tools/aubdump.c | 7 ++++---
>>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/tools/aubdump.c b/tools/aubdump.c
>>> index 267061b0fc2b..2d2b6c607a43 100644
>>> --- a/tools/aubdump.c
>>> +++ b/tools/aubdump.c
>>> @@ -394,10 +394,11 @@ gen8_emit_ggtt_pte_for_range(uint64_t start, uint64_t end)
>>>   
>>>   	entry_addr = start & ~(4096 - 1);
>>>   	do {
>>> +		uint64_t last_page_entry, num_entries;
>>> +
>>>   		page_num = entry_addr >> 21;
>>> -		uint64_t last_page_entry =
>>> -			min((page_num + 1) << 21, end_aligned);
>>> -		uint64_t num_entries = (last_page_entry - entry_addr) >> 12;
>>> +		last_page_entry = min((page_num + 1) << 21, end_aligned);
>>> +		num_entries = (last_page_entry - entry_addr) >> 12;
>>>   		mem_trace_memory_write_header_out(
>>>   			entry_addr >> 9, num_entries * GEN8_PTE_SIZE,
>>>   			AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
>>> -- 
>>> 2.14.1
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
>> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Scott D Phillips <scott.d.phillips@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tools/aubdump: Fix ISO C90 forbids mixed declarations and code warning
Date: Tue, 10 Apr 2018 07:57:19 -0700	[thread overview]
Message-ID: <8737039kj4.fsf@intel.com> (raw)
In-Reply-To: <d54d4c59-5535-02bc-c55d-df52c0f0d6a1@linux.intel.com>

Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> writes:

> On 09/04/2018 18:03, Scott D Phillips wrote:
>> Tvrtko Ursulin <tursulin@ursulin.net> writes:
>> 
>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>
>>> Back to a clean build with no warnings, at least for me.
>> 
>> Why c90? If that's the language we mean to target then we should
>> probably add it to the build system so people with gcc 5.1 and later
>> will see the warnings too. fwiw, my build with clang 6 gives a couple
>> dozen warnings.
>
> I am building under Ubuntu 17.10 with GCC 7.2.0. Normal configure && 
> make, and get this warning. And since I can't spot that IGT is setting 
> the C standard explicitly, I guess that's the default.

Ah, turns out it's not -std=c90, but an explicit
-Wdeclaration-after-statement that we pick up through
XORG_DEFAULT_OPTIONS. Clang seems to emit that warning only if it's in
c90 mode, which is why I didn't see it. So I'll say

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>

> This one is the only warning on my build btw.
>
> Regards,
>
> Tvrtko
>
>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>>> Cc: Scott D Phillips <scott.d.phillips@intel.com>
>>> ---
>>>   tools/aubdump.c | 7 ++++---
>>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/tools/aubdump.c b/tools/aubdump.c
>>> index 267061b0fc2b..2d2b6c607a43 100644
>>> --- a/tools/aubdump.c
>>> +++ b/tools/aubdump.c
>>> @@ -394,10 +394,11 @@ gen8_emit_ggtt_pte_for_range(uint64_t start, uint64_t end)
>>>   
>>>   	entry_addr = start & ~(4096 - 1);
>>>   	do {
>>> +		uint64_t last_page_entry, num_entries;
>>> +
>>>   		page_num = entry_addr >> 21;
>>> -		uint64_t last_page_entry =
>>> -			min((page_num + 1) << 21, end_aligned);
>>> -		uint64_t num_entries = (last_page_entry - entry_addr) >> 12;
>>> +		last_page_entry = min((page_num + 1) << 21, end_aligned);
>>> +		num_entries = (last_page_entry - entry_addr) >> 12;
>>>   		mem_trace_memory_write_header_out(
>>>   			entry_addr >> 9, num_entries * GEN8_PTE_SIZE,
>>>   			AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
>>> -- 
>>> 2.14.1
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
>> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-04-10 14:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 16:35 [igt-dev] [PATCH i-g-t] tools/aubdump: Fix ISO C90 forbids mixed declarations and code warning Tvrtko Ursulin
2018-04-09 16:35 ` Tvrtko Ursulin
2018-04-09 17:03 ` [Intel-gfx] " Scott D Phillips
2018-04-09 17:03   ` Scott D Phillips
2018-04-10  7:42   ` [igt-dev] " Tvrtko Ursulin
2018-04-10  7:42     ` Tvrtko Ursulin
2018-04-10 14:57     ` Scott D Phillips [this message]
2018-04-10 14:57       ` Scott D Phillips
2018-04-09 17:28 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-04-09 22:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737039kj4.fsf@intel.com \
    --to=scott.d.phillips@intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tursulin@ursulin.net \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.