Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #140091

Re: compiling [old] c code

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: compiling [old] c code
Date 2019-01-22 16:46 +0000
Organization A noiseless patient Spider
Message-ID <87fttkzllq.fsf@bsb.me.uk> (permalink)
References (2 earlier) <d1e29de5-8371-44ef-965c-3762392a7822@googlegroups.com> <87d0oq19sq.fsf_-_@bsb.me.uk> <f6946512-fc7d-44d1-bcf7-68e7780b4898@googlegroups.com> <877eex273c.fsf@bsb.me.uk> <048927d3-9039-4cce-84a2-1eec71d65eb5@googlegroups.com>

Show all headers | View raw


fir <profesor.fir@gmail.com> writes:

> W dniu poniedziałek, 21 stycznia 2019 19:34:08 UTC+1 użytkownik Ben Bacarisse napisał:
>> fiziqs@gmail.com writes:
>> 
>> > On Monday, January 21, 2019 at 1:21:02 PM UTC+1, Ben Bacarisse wrote:
>> >> fiziqs@gmail.com writes:
>> >> 
>> >> > On Monday, January 21, 2019 at 1:45:03 AM UTC+1, Geoff wrote:
>> >> >> On Sun, 20 Jan 2019 14:51:00 -0800 (PST), fiziqs@gmail.com wrote:
>> >> <snip>
>> >> >> >I tried to compile a bit of code from the original Unix source and
>> >> >> >ran into the following problem:
>> >> <snip>
>> >> > Actually, it was the EFL language, just to know if it is still
>> >> > possible to compile this language:
>> >> > https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/old/efl
>> >> 
>> >> Is there a link that allows a directory to be downloaded?  It looks much
>> >> more tractable than the very old C I, and others, were thinking about.
>> >> The sources there are from about 1982 and look like normal K&R C.
>> >> 
>> > Only as part of:
>> > https://www.tuhs.org/Archive/Distributions/UCB/4.4BSD-Alpha/src.tar.gz
>> 
>> That's not quite the same (no Makefile for example) but I assume C the
>> sources are similar.
>> 
>> Despite the date (1982) it is very old C.  I think you will struggle to
>> get it through a modern compiler.
>> 
>> Apart form the "big union" idea that's already been mentioned, you coud
>> try a macro:
>> 
>> #define PTR(p, s) ((struct s *)(p))
>> 
>> and re-write things like
>> 
>>   ttype = t->vtype;
>> 
>> as
>> 
>>   ttype = PTR(t, varblock)->vtype;
>> 
>> You might even be able to automate this a bit by using something like
>> Perl to record what structs have what members.
>
> it seems to me that he dont need to rewrite field acceses only maybe
> put 
>
> ptr = (struct some*) ptr; //?
>
> in thet few places

This would be a constraint violation and yet would achieve nothing.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

compiling all c code fiziqs@gmail.com - 2019-01-20 14:51 -0800
  Re: compiling all c code Richard Damon <Richard@Damon-Family.org> - 2019-01-20 18:41 -0500
  Re: compiling all c code gazelle@shell.xmission.com (Kenny McCormack) - 2019-01-20 23:42 +0000
  Re: compiling all c code Geoff <geoff@invalid.invalid> - 2019-01-20 16:44 -0800
    Re: compiling all c code fiziqs@gmail.com - 2019-01-21 02:36 -0800
      Re: compiling [old] c code Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-01-21 12:20 +0000
        Re: compiling [old] c code fiziqs@gmail.com - 2019-01-21 04:58 -0800
          Re: compiling [old] c code Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-01-21 18:33 +0000
            Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-22 04:21 -0800
              Re: compiling [old] c code Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-01-22 16:46 +0000
                Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-22 10:35 -0800
                Re: compiling [old] c code Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-01-22 22:45 +0000
                Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-22 14:58 -0800
                Re: compiling [old] c code Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-01-23 02:12 +0000
                Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-23 00:59 -0800
        Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-22 03:34 -0800
          Re: compiling [old] c code fir <profesor.fir@gmail.com> - 2019-01-22 04:08 -0800
      Re: compiling all c code Keith Thompson <kst-u@mib.org> - 2019-01-21 14:23 -0800

csiph-web