On Thu, 10 Mar 2016 09:11:52 +0100
Olivier MATZ wrote:
>
> > I would rather have the mempool_audit code take a non-const argument.
> > The macro method sets a bad precedent and will encourage more bad code.
> > Plus code checkers are likely to flag any such usage as suspect.
>
> Doing that woul
Hi Bruce,
On 03/10/2016 10:26 AM, Bruce Richardson wrote:
> On Thu, Mar 10, 2016 at 09:29:03AM +0100, Olivier MATZ wrote:
If you have a better alternative, without duplicating the code,
I'll be happy to learn.
>>>
>>> I really don't like this dropping of const either, but I do see the pr
>> If you have a better alternative, without duplicating the code,
>> I'll be happy to learn.
>
> I really don't like this dropping of const either, but I do see the problem.
> I'd nearly rather see two copies of the function than start dropping the const
> in such a way.
I don't think duplicatin
On Thu, Mar 10, 2016 at 09:29:03AM +0100, Olivier MATZ wrote:
> >> If you have a better alternative, without duplicating the code,
> >> I'll be happy to learn.
> >
> > I really don't like this dropping of const either, but I do see the problem.
> > I'd nearly rather see two copies of the function
> I would rather have the mempool_audit code take a non-const argument.
> The macro method sets a bad precedent and will encourage more bad code.
> Plus code checkers are likely to flag any such usage as suspect.
Doing that would imply dropping the const qualifier in several
functions:
- rte_mem
Hi,
On 03/09/2016 07:53 PM, Stephen Hemminger wrote:
> Can't we just write correct code rather than trying to trick the compiler.
Thank you for your comment. This macro is introduced for next
commit, I would be happy if you could help me to remove it.
My opinion is that using a macro like this i
On Wed, Mar 09, 2016 at 09:47:35PM +0100, Olivier MATZ wrote:
> Hi,
>
> On 03/09/2016 07:53 PM, Stephen Hemminger wrote:
> > Can't we just write correct code rather than trying to trick the compiler.
>
> Thank you for your comment. This macro is introduced for next
> commit, I would be happy if y
This macro removes the const attribute of a variable. It must be used
with care in specific situations. It's better to use this macro instead
of a manual cast, as it explicitly shows the intention of the developer.
This macro is used in the next commit of the series.
Signed-off-by: Olivier Matz
On Wed, 9 Mar 2016 21:47:35 +0100
Olivier MATZ wrote:
> Hi,
>
> On 03/09/2016 07:53 PM, Stephen Hemminger wrote:
> > Can't we just write correct code rather than trying to trick the compiler.
>
> Thank you for your comment. This macro is introduced for next
> commit, I would be happy if you cou
Can't we just write correct code rather than trying to trick the compiler.
On Wed, Mar 9, 2016 at 8:19 AM, Olivier Matz wrote:
> This macro removes the const attribute of a variable. It must be used
> with care in specific situations. It's better to use this macro instead
> of a manual cast, as
10 matches
Mail list logo