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


Groups > comp.lang.c > #140035

Re: compiling all c code

Subject Re: compiling all c code
Newsgroups comp.lang.c
References <cbbefd94-59bf-489e-84c6-2633c289f119@googlegroups.com>
From Richard Damon <Richard@Damon-Family.org>
Message-ID <VG71E.72254$e75.36443@fx34.iad> (permalink)
Organization Forte - www.forteinc.com
Date 2019-01-20 18:41 -0500

Show all headers | View raw


On 1/20/19 5:51 PM, fiziqs@gmail.com wrote:
> Dear All,
> 
> I tried to compile a bit of code from the original Unix source and ran into the following problem:
> they defined a "generic pointer type" ptr (actually it is a typedef), and pointers are casted to this. Also ones for structs.
> Now, gcc does not accept the -> for such pointers.
> Is there some way (e.g., compiler option) to get around this, or the only way is to look up for all these what kind of structure they refer to, and change their type?
> 
> Thanks a lot in advance.
> 

Very ancient proto-C put all structs members into a single address
space, and thus any (struct) pointer could be used to offset into a
structure to get that member. This is no longer valid C. Unless you have
a compiler that understands this ancient proto-c language as an option,
you are going to need to fix the code.

One option that might work is to gather all these struct definitions
into a single anonymous union, and then you just need to make pointers
that access any of these structures be pointers to that type of union.
That might be a bit less work.

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