[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: [Pcc] [C99] identifier length
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2022-11-21 19:31:13
Message-ID: 8f6bbbf2-f975-74f8-d7d7-7b5e087eae5e () ludd ! ltu ! se
[Download RAW message or body]

Fixed.  Now warns but it do not truncate long identifiers.

-- R

Den 2022-11-21 kl. 10:32, skrev Domingo Alvarez Duarte:
> When trying to compile https://github.com/facebookincubator/CG-SQL 
> amalgamation I was getting the same problems reported at 
> https://marc.info/?l=pcc-list&m=163058129223824&w=2 "identifier 
> exceeds C99 5.2.4.1, truncating" and failing to compile.
>
> Then looking at a possible fix for it I came with this solution:
>
> =====
>
> diff --git a/cc/cpp/cpp.h b/cc/cpp/cpp.h
> index 6191a0b4..72d00c62 100644
> --- a/cc/cpp/cpp.h
> +++ b/cc/cpp/cpp.h
> @@ -74,7 +74,9 @@ typedef    unsigned int mvtyp;
>  extern usch pbbeg[], *pbinp, *pbend;
>
>  #define    MAXARGS    128    /* Max # of args to a macro. Should be 
> enough */
> +#ifndef MAXIDSZ
>  #define    MAXIDSZ    63    /* Max length of C99 identifier; 5.2.4.1 */
> +#endif
>
>  #define    PBMAX    10    /* min pushbackbuffer size */
>
> =====
>
> And then when executing configure to build:
>
> =====
>
> CPPFLAGS="-DMAXIDSZ=128" ../configure --prefix=$HOME/local/pcc-cvs
>
> =====
>
> Now I can build it:
>
> Without optimization:
>
> =====
>
> mk-cql.sh
> 1.33user 0.06system 0:01.40elapsed 99%CPU (0avgtext+0avgdata 
> 48640maxresident)k
> 0inputs+4264outputs (0major+27511minor)pagefaults 0swaps
> =====
>
> With optimization:
>
> =====
>
> mk-cql.sh
> 1.72user 0.05system 0:01.78elapsed 99%CPU (0avgtext+0avgdata 
> 34928maxresident)k
> 0inputs+2920outputs (0major+33839minor)pagefaults 0swaps
>
> =====
>
> mk-cql.sh
>
> =====
>
> #!/bin/sh
> cqlh=$HOME/dev/dadbiz++/third-party/dad/CG-SQL/sources/out
> pcc-env /usr/bin/time pcc  \
>     -O -o  cql\
>     $cqlh/cql_amalgam.c -lm
>
> =====
>
> Cheers !
>
> _______________________________________________
> Pcc mailing list
> Pcc@lists.ludd.ltu.se
> https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc

_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic