GaloisInc / ivory

The Ivory EDSL
http://ivorylang.org
BSD 3-Clause "New" or "Revised" License
393 stars 28 forks source link

Bad char literal output #81

Closed cblp closed 8 years ago

cblp commented 8 years ago

Source:

iarray $ map (ival . char) "hello\0"

GCC error:

gen-ivory-char-issue.c:13:51: error: unknown escape sequence: '\N' [-Werror]
     char n_local0[6U] = {'h', 'e', 'l', 'l', 'o', '\NUL'};
                                                   ^
gen-ivory-char-issue.c:13:51: error: multi-character character constant [-Werror=multichar]
gen-ivory-char-issue.c:13:51: error: overflow in implicit constant conversion [-Werror=overflow]
acfoltzer commented 8 years ago

@elliottt: is this a language-c-quote bug?

> putDocLn (ppr [cexp| $char:('\0') |])
'\NUL'
elliottt commented 8 years ago

Looks like it, we don't process its output at all.

On Fri, Aug 12, 2016 at 8:07 AM Adam C. Foltzer notifications@github.com wrote:

@elliottt https://github.com/elliottt: is this a language-c-quote bug?

putDocLn (ppr [cexp| $char:('\0') |]) '\NUL'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GaloisInc/ivory/issues/81#issuecomment-239471976, or mute the thread https://github.com/notifications/unsubscribe-auth/AABYtCzBjyd7--ioE7j_3d5p5H41lRgZks5qfIw7gaJpZM4JjHMq .

cblp commented 8 years ago

I'm sorry guys, I should have investigated this deeper.