[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UDUNITS #QVW-190351]: ut_get_converter and constness of args.


> I tried changing the function declaration and definition to take constant
> pointers to constant ut_units and udunits2 compiled fine.

That surprises me because, as I said, the ut_get_converter() function might 
modify the passed-in units.

> I only tried
> compiling with gcc (version 4.3.2 20081105 (Red Hat 4.3.2-7)) though.

Probably indicates a bug in gcc 4.3.2.

> The reason I'm interested in this, is that I've written a C++ wrapper for the
> library, and passing temporaries to reference variables requires constant
> references.  Currently I'm casting away the constantness to call
> ut_get_converter, but I'd like to avoid that if possible.

Sorry, I'm afraid I can't simultaneously help you *and* keep my contract with 
the C programming language.

> Erik
> --
> Erik Zeek                     |  \|/ ____ \|/
> SMTS, Org 5444, MS-1153       |  "@'/ .. \`@"
> Sandia National Laboratories  |  /_| \__/ |_\
> Phone: 505-845-0513           |     \__U_/

Steve Emmerson

Ticket Details
Ticket ID: QVW-190351
Department: Support UDUNITS
Priority: Normal
Status: Closed