The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Old C code
@ 2006-02-23 16:41 Sergey Lapin
  2006-02-23 20:43 ` Jim Capp
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Lapin @ 2006-02-23 16:41 UTC (permalink / raw)


Hi, all!
I just dug into sed.h from 32V version of sed:

gcc can't parse the following code:
union   reptr {
        struct reptr1 {
                char    *ad1;
                char    *ad2;
                char    *re1;
                char    *rhs;
                FILE    *fcode;
                char    command;
                char    gfl;
                char    pfl;
                char    inar;
                char    negfl;
        };
        struct reptr2 {
                char    *ad1;
                char    *ad2;
                union reptr     *lb1;
                char    *rhs;
                FILE    *fcode;
                char    command;
                char    gfl;
                char    pfl;
                char    inar;
                char    negfl;
        };
} ptrspace[PTRSIZE], *rep;

Does anyone know current form of that, or how to force this
to compile and work?

Thanks a lot!

S.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [TUHS] Old C code
  2006-02-23 16:41 [TUHS] Old C code Sergey Lapin
@ 2006-02-23 20:43 ` Jim Capp
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Capp @ 2006-02-23 20:43 UTC (permalink / raw)


Shouldn't be a problem.  I defined PTRSIZE and added an #include <stdio.h>
and gcc compiled it fine for me.

--------------- try this -------------------

#define PTRSIZE	10
#include <stdio.h>

union   reptr {
        struct reptr1 {
                char    *ad1;
                char    *ad2;
                char    *re1;
                char    *rhs;
                FILE    *fcode;
                char    command;
                char    gfl;
                char    pfl;
                char    inar;
                char    negfl;
        };
        struct reptr2 {
                char    *ad1;
                char    *ad2;
                union reptr     *lb1;
                char    *rhs;
                FILE    *fcode;
                char    command;
                char    gfl;
                char    pfl;
                char    inar;
                char    negfl;
        };
} ptrspace[PTRSIZE], *rep;


main( )
{
printf( "hello world\n" );
}
--------------------------------------------

On Thu, Feb 23, 2006 at 07:41:45PM +0300, Sergey Lapin wrote:
> Hi, all!
> I just dug into sed.h from 32V version of sed:
> 
> gcc can't parse the following code:
> union   reptr {
>         struct reptr1 {
>                 char    *ad1;
>                 char    *ad2;
>                 char    *re1;
>                 char    *rhs;
>                 FILE    *fcode;
>                 char    command;
>                 char    gfl;
>                 char    pfl;
>                 char    inar;
>                 char    negfl;
>         };
>         struct reptr2 {
>                 char    *ad1;
>                 char    *ad2;
>                 union reptr     *lb1;
>                 char    *rhs;
>                 FILE    *fcode;
>                 char    command;
>                 char    gfl;
>                 char    pfl;
>                 char    inar;
>                 char    negfl;
>         };
> } ptrspace[PTRSIZE], *rep;
> 
> Does anyone know current form of that, or how to force this
> to compile and work?
> 
> Thanks a lot!
> 
> S.
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> http://minnie.tuhs.org/mailman/listinfo/tuhs



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-23 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 16:41 [TUHS] Old C code Sergey Lapin
2006-02-23 20:43 ` Jim Capp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).