Anders Magnusson | 9 Jan 2011 16:32
Picon

More cpp changes

...hopefully this is the last...

I have rewritten how a macro is rescanned for more macros to expand by 
using iteration
instead of recursion.  All test cases and all code I have tested works.

The earlier logic failed on simple things like

#define X(...)
#define Y(...)  __VA_ARGS__
Y(X X() ())

which should expand to nothing in c99.

-- Ragge

Anders Magnusson | 9 Jan 2011 22:00
Picon

Re: [pcc] pcc-101105 snapshot and --version

On 11/27/2010 10:13 PM, Anders Magnusson wrote:
> On 11/26/2010 10:21 PM, Thorsten Glaser wrote:
>> Anders Magnusson dixit:
>>
>>> I assume you want compile date
>> Actually, compile date is not saying much, at least, it may
>> even be outright dangerous. Can you amend your cvs checkout
>> script to write $(date +'%Y%M%D') into a file and configure
>> to read that and append it to pcc-snapshot's version number
>> (if it exists, otherwise do nothing)?
> Yes, you are correct.  I'll try to fix this.
...and fixed.  Now the checkout date will be the date given in the 
version string.

-- Ragge

Thorsten Glaser | 9 Jan 2011 23:29
Picon
Gravatar

mips

Hi,

with a few hacks (copied *.o files from gcc, cp libgcc.a libpcc.a,
since I didn’t have its source checked out nor internet access;
and different -dynamic-linker and entry point (different number of
_ preceding start), I’ve cross-built a hello world for µClibc on
mips (with a speed startling my friend, who’s developing a toolkit
for building embedded systems).

Thought you wanted to know ☺

bye,
//mirabilos
--

-- 
  “Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool.”
						-- Edward Burr

Iain Hibbert | 10 Jan 2011 10:15

Re: More cpp changes

On Sun, 9 Jan 2011, Anders Magnusson wrote:

> ...hopefully this is the last...

never!

> I have rewritten how a macro is rescanned for more macros to expand by
> using iteration instead of recursion.  All test cases and all code I
> have tested works.

I saw a build failure on GCC due to discarded qualifiers, patch below..

iain

Index: cpp.c
===================================================================
RCS file: /cvsroot/pcc/cc/cpp/cpp.c,v
retrieving revision 1.112
diff -u -r1.112 cpp.c
--- cpp.c	9 Jan 2011 15:25:39 -0000	1.112
+++ cpp.c	10 Jan 2011 09:10:18 -0000
 <at>  <at>  -135,7 +135,7  <at>  <at> 
 usch *xstrdup(const char *str);
 const usch *prtprag(const usch *opb);
 static void addidir(char *idir, struct incs **ww);
-void imp(char *);
+void imp(const char *);
 #define IMP(x) if (dflag>1) imp(x)

 int
(Continue reading)

Anders Magnusson | 10 Jan 2011 10:46
Picon

Re: More cpp changes

Thanks, checked in.

-- Ragge

Iain Hibbert wrote:
> On Sun, 9 Jan 2011, Anders Magnusson wrote:
>
>   
>> ...hopefully this is the last...
>>     
>
> never!
>
>   
>> I have rewritten how a macro is rescanned for more macros to expand by
>> using iteration instead of recursion.  All test cases and all code I
>> have tested works.
>>     
>
> I saw a build failure on GCC due to discarded qualifiers, patch below..
>
> iain
>
> Index: cpp.c
> ===================================================================
> RCS file: /cvsroot/pcc/cc/cpp/cpp.c,v
> retrieving revision 1.112
> diff -u -r1.112 cpp.c
> --- cpp.c	9 Jan 2011 15:25:39 -0000	1.112
> +++ cpp.c	10 Jan 2011 09:10:18 -0000
(Continue reading)

Iain Hibbert | 10 Jan 2011 10:52

Re: More cpp changes

On Mon, 10 Jan 2011, Iain Hibbert wrote:
> On Sun, 9 Jan 2011, Anders Magnusson wrote:
> > I have rewritten how a macro is rescanned for more macros to expand by
> > using iteration instead of recursion.  All test cases and all code I
> > have tested works.
>
> I saw a build failure on GCC due to discarded qualifiers, patch below..

Also, _Pragma expansion seems to be broken..  I get "bad pragma operator"
for a file containing just _Pragma("string") for example..

I'm not sure, here, that pragoper() function looks right, seems it would
produce an error "pragoper expmac" during normal operation?

iain

Nicolas Joly | 10 Jan 2011 11:53
Picon
Picon
Favicon

Re: More cpp changes

On Mon, Jan 10, 2011 at 09:52:49AM +0000, Iain Hibbert wrote:
> On Mon, 10 Jan 2011, Iain Hibbert wrote:
> > On Sun, 9 Jan 2011, Anders Magnusson wrote:
> > > I have rewritten how a macro is rescanned for more macros to expand by
> > > using iteration instead of recursion.  All test cases and all code I
> > > have tested works.
> >
> > I saw a build failure on GCC due to discarded qualifiers, patch below..
> 
> Also, _Pragma expansion seems to be broken..  I get "bad pragma operator"
> for a file containing just _Pragma("string") for example..
> 
> I'm not sure, here, that pragoper() function looks right, seems it would
> produce an error "pragoper expmac" during normal operation?

Indeed.

njoly <at> petaure [~]> cat main.c
#define __BEGIN  _Pragma("GCC visibility push(default)")
#define __END    _Pragma("GCC visibility pop")

__BEGIN
extern int foo;
__END

int main() { return 0; }
njoly <at> petaure [~]> pcc -o main main.c
main.c:4: error: pragoper expmac

--

-- 
(Continue reading)

Iain Hibbert | 10 Jan 2011 18:35

Re: [pcc] pcc-101105 snapshot and --version

On Sun, 9 Jan 2011, Anders Magnusson wrote:

> Now the checkout date will be the date given in the version string.

the DATESTAMP file should be referenced as $srcdir/DATESTAMP I think?
(as patch below, and regen configure)

actually I'm not sure of this, as I see[1] an AC_REQUIRE_AUX_FILE() macro
that probably should be used to ensure the existence of the file, which
implies that it should be in $aux_dir ?

(however, I don't see a variable by that name, there is ac_aux_dir perhaps
thats it.. :)

regards,
iain

[1] http://www.gnu.org/software/hello/manual/autoconf/Input.html

Index: configure.ac
===================================================================
RCS file: /cvsroot/pcc/configure.ac,v
retrieving revision 1.91
diff -u -r1.91 configure.ac
--- configure.ac	9 Jan 2011 20:59:07 -0000	1.91
+++ configure.ac	10 Jan 2011 17:15:34 -0000
 <at>  <at>  -438,7 +438,7  <at>  <at> 
 pcc_major=`echo $PACKAGE_VERSION | awk -F. '{print $1}'`
 pcc_minor=`echo $PACKAGE_VERSION | awk -F. '{print $2}'`
 pcc_minorminor=`echo $PACKAGE_VERSION | awk -F. '{print $3}'`
(Continue reading)

Anders Magnusson | 11 Jan 2011 11:01
Picon

Re: More cpp changes

Nicolas Joly wrote:
> On Mon, Jan 10, 2011 at 09:52:49AM +0000, Iain Hibbert wrote:
>   
>> On Mon, 10 Jan 2011, Iain Hibbert wrote:
>>     
>>> On Sun, 9 Jan 2011, Anders Magnusson wrote:
>>>       
>>>> I have rewritten how a macro is rescanned for more macros to expand by
>>>> using iteration instead of recursion.  All test cases and all code I
>>>> have tested works.
>>>>         
>>> I saw a build failure on GCC due to discarded qualifiers, patch below..
>>>       
>> Also, _Pragma expansion seems to be broken..  I get "bad pragma operator"
>> for a file containing just _Pragma("string") for example..
>>
>> I'm not sure, here, that pragoper() function looks right, seems it would
>> produce an error "pragoper expmac" during normal operation?
>>     
>
> Indeed.
>
> njoly <at> petaure [~]> cat main.c
> #define __BEGIN  _Pragma("GCC visibility push(default)")
> #define __END    _Pragma("GCC visibility pop")
>
> __BEGIN
> extern int foo;
> __END
>
(Continue reading)

Fred J. Tydeman | 11 Jan 2011 19:41

pcc --help

I just installed pcc onto Intel Pentium 4 in 32-bit mode
running Linux Fedora Core 14.  I installed via software install
of a RPM package.  I believe it is 2010/11/07 version of pcc.

Doing: 
pcc --help 
gets
 Usage: /usr/bin/ld [options] file...
 Options:
   -a KEYWORD                  Shared library control for HP/UX compatibility
 ...
that is, it tells me about the linker, not the compiler.
So, how do I get the help information about the compiler?

---
Fred J. Tydeman        Tydeman Consulting
tydeman <at> tybor.com      Testing, numerics, programming
+1 (775) 358-9748      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.


Gmane