tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for li


From: avih
Subject: Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for libs
Date: Sun, 5 Jul 2020 06:34:10 +0000 (UTC)

For me, with current tcc mob (but also with version at least 6 months
old) this does work: tcc hello.c -l c

Which version did you try?

As for -O, it seems that the option-argument is optional - in both
tcc and gcc. The posix syntax for optional arguments is that the
value must follow at the same argument, hence it's obvious why space
doesn't work.

The c99 spec says for -O that "Other optlevel values may be supported."
which doesn't suggest it can be optional, but IMHO compatibility with
gcc and clang options in this regards is stronger than the posix
requirement, i.e. this should work: tcc -O hello.c

Avi


On Sunday, July 5, 2020, 01:16:12 AM GMT+3, John Scott <jscott@posteo.net> wrote:


Hi,

I was checking if tcc conforms to the POSIX standard for a C99 compiler [1],
particularly to make the case for implementing a generic POSIX C compiler
backend in Meson [2]. In the meantime, tcc can't be used for building. There
is concern that small compilers all have their own caveats, and tinycc's seem
minor.

POSIX says a space after -l—and all flags for that matter—is okay, but tcc
doesn't accept this:
$ tcc hello.c -l c
tcc: error: library '' not found

It also doesn't handle a space after -O. Fortunately -D, -I, -L, and -U all
tolerate this.

For completeness here's another discrepancy:
* tcc errors with -lxnet or -ltrace, but so do gcc and Clang.

Please let me know if there's anything I can do to help, and thanks for
working on tinycc!

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
[2] https://github.com/mesonbuild/meson/issues/5406
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]