lkml.org 
[lkml]   [2011]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
On 06/30/2011 06:20 PM, Brian Gerst wrote:
> On Thu, Jun 30, 2011 at 8:47 PM, H. Peter Anvin <hpa@linux.intel.com> wrote:
>> On 06/30/2011 05:41 PM, Greg Dietsche wrote:
>>> On Thu, Jun 30, 2011 at 05:25:36PM -0700, H. Peter Anvin wrote:
>>>> On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
>>>>> + const char const *names[] = { "ID", "VERSION", "SPIV" };
>>>> ^^^^^^^^^^^^^^^^
>>>>
>>>> Doesn't make sense, patch removed...
>>>>
>>> could you explain a little more? I don't see my mistake.
>>> it compiles and is running on my box currently.
>>>
>
> One const is for the strings, the other is for the array of pointers.
>

Yes, the syntax is wrong for that.

const char * const names[] is I think what he wanted.

-hpa


\
 
 \ /
  Last update: 2011-07-01 03:25    [W:0.095 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site