[ovs-dev] [PATCH] ovsdb-idlc: Fix warning in generated code.
Ben Pfaff
blp at nicira.com
Fri Jun 18 16:40:38 UTC 2010
Thanks, I pushed this out.
On Thu, Jun 17, 2010 at 09:50:07PM -0700, Justin Pettit wrote:
> Seems reasonable.
>
> --Justin
>
>
> On Jun 17, 2010, at 3:25 PM, Ben Pfaff wrote:
>
> > Without this fix, ovsdb-idlc generates the following line of code:
> > c->type.key.u.integer.max = 4294967295;
> > which causes GCC to issue this warning:
> > this decimal constant is unsigned only in ISO C90
> >
> > This commit changes the generated code to:
> > c->type.key.u.integer.max = INT64_C(4294967295);
> > which eliminates the warning.
> > ---
> > ovsdb/OVSDB.py | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/ovsdb/OVSDB.py b/ovsdb/OVSDB.py
> > index 6e426e5..0cd416e 100644
> > --- a/ovsdb/OVSDB.py
> > +++ b/ovsdb/OVSDB.py
> > @@ -329,9 +329,9 @@ class BaseType:
> > stmts += self.enum.cInitDatum("%s.enum_" % var)
> > if self.type == 'integer':
> > if self.minInteger != None:
> > - stmts.append('%s.u.integer.min = %d;' % (var, self.minInteger))
> > + stmts.append('%s.u.integer.min = INT64_C(%d);' % (var, self.minInteger))
> > if self.maxInteger != None:
> > - stmts.append('%s.u.integer.max = %d;' % (var, self.maxInteger))
> > + stmts.append('%s.u.integer.max = INT64_C(%d);' % (var, self.maxInteger))
> > elif self.type == 'real':
> > if self.minReal != None:
> > stmts.append('%s.u.real.min = %d;' % (var, self.minReal))
> > --
> > 1.7.1
> >
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>
More information about the dev
mailing list