Subject: [Cbor] Question about draft-ietf-cbor-cddl-08 abnf

From: Daniel P <[email-masked]>
Date: Fri, 17 May 2019 16:37:28 -0400

Regarding

hexfloat = "0x" 1*HEXDIG ["." 1*HEXDIG] "p" exponent

should hexfloat allow an optional leading minus sign? C/C++ allows that.

Thanks,
Daniel

---

From: Carsten Bormann <[email-masked]>
Date: Fri, 17 May 2019 23:11:10 +0200

On May 17, 2019, at 22:37, Daniel P <[email-masked]> wrote:
> should hexfloat allow an optional leading minus sign?

Yes.  

I believe you found a bug.

Would 

hexfloat = [“-"] "0x" 1*HEXDIG ["." 1*HEXDIG] “p" exponent

work for you?

> C/C++ allows that.

Actually, it doesn’t.  

https://en.cppreference.com/w/c/language/integer_constant
has this note:
There are no negative integer constants. Expressions such as -1 apply the unary minus operator to the value represented by the constant, which may involve implicit type conversions.

The same is true for floating point constants.
Both only work if you have a unary minus operator in the language.  
In CDDL, we don’t.  
Copying the C productions is what made us create this bug…

Grüße, Carsten

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 22 May 2019 16:40:50 +0200

> hexfloat = [“-"] "0x" 1*HEXDIG ["." 1*HEXDIG] “p" exponent

Daniel already confirmed off-list that he also thinks this fixes the bug.

I would like to bring this up briefly at the interim in 19 minutes so we can agree this should be fixed in AUTH48.

Grüße, Carsten