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

2020-07-04 Thread avih via Tinycc-devel
 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  
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
  ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


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

2020-07-04 Thread Christian Jullien
An alternate and maybe easier solution is to add a c99 (POSIX) shell script in 
tcc repository that handles all c99 option and forward them to tcc supported 
syntax (e.g. "-O2" => -O2 but also "-O 2" => -O2)

-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Sunday, July 05, 2020 06:56
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] POSIX compliance; spaces not supported with -l for 
libs

Hello John,

I like very much the idea to make tcc POSIX compliant. I still work on C/C++ 
normalization in AFNOR group and worked on different groups including ISLISP 
and POSIX, so standards matter for me :).

Please, also consider that neither gcc nor clang support space after -O:

$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'

$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'

I think that nobody will refuse a patch that fully supports POSIX compatible 
option as long it does not break gcc/cl compatibility.

libxnet and libtrace may be especially checked by configure (new --posix) 
option and dropped from command line if not supplied by the system. An 
alternate solution is to make almost empty libxnet.a and libtrace.a when 
--posix option is set by ./configure

Can you try to propose something?

C.


-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of John Scott
Sent: Sunday, July 05, 2020 00:15
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] POSIX compliance; spaces not supported with -l for libs

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


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


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

2020-07-04 Thread Christian Jullien
Hello John,

I like very much the idea to make tcc POSIX compliant. I still work on C/C++ 
normalization in AFNOR group and worked on different groups including ISLISP 
and POSIX, so standards matter for me :).

Please, also consider that neither gcc nor clang support space after -O:

$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'

$ clang -O 3 cspy.c -l m
clang: error: no such file or directory: '3'

I think that nobody will refuse a patch that fully supports POSIX compatible 
option as long it does not break gcc/cl compatibility.

libxnet and libtrace may be especially checked by configure (new --posix) 
option and dropped from command line if not supplied by the system. An 
alternate solution is to make almost empty libxnet.a and libtrace.a when 
--posix option is set by ./configure

Can you try to propose something?

C.


-Original Message-
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of John Scott
Sent: Sunday, July 05, 2020 00:15
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] POSIX compliance; spaces not supported with -l for libs

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


[Tinycc-devel] POSIX compliance; spaces not supported with -l for libs

2020-07-04 Thread John Scott
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

signature.asc
Description: This is a digitally signed message part.
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel