On 23.07.2023 16:11, wizzwizz4 via Tinycc-devel wrote:
I tried compiling QuickJS with tcc.
After setting `-DEMSCRIPTEN -DCONFIG_VERSION=""`, I get:

quickjs.c:2664: warning: function might return no value: 'JS_AtomGetKind'
quickjs.c:39834: error: initializer element is not constant

I'm guessing the error has something to do with this:

See tccgen.c:2491:

        /* NOTE: we only do constant propagation if finite number (not
           NaN or infinity) (ANSI spec) */

Not necessarily saying that this is what tcc is actually doing and/or
should do....

-- gr


$ tcc -run -
a = { 1e1000 };
b = { -1e54 };
c = { __inf__ };
d = { +__inf__ };
e = { -1.0 / 0.0 };
f = { -__inf__ };
-:6: error: initializer element is not constant

For some reason, -__inf__ isn't considered a constexpr.
Neither is -1e320, or -__nan__.
Negating other float values, or not negating these ones, is fine.

(Reader note: __inf__ and __nan__ are TCC implementation details;
  in real programs, INFINITY and NAN from <math.h> should be used
  instead.)

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to