🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Brian Bershad Thu, 04 Sep 1986 09:10
pointers to functions returning typedefs in structures
#297
Author: Brian Bershad
Date: Thu, 04 Sep 1986 09:10
32 lines
1112 bytes

The following won't compile:

--------------------------------
typedef char * memory ;

struct S	{
	memory (*A)(), memory (*B)();	// this is a syntax error
};

---
but
---

Struct S	{
	memory (*A)();
	memory (*B)();
};


will.

I am still running 1.0 relE here... is this something that has been
fixed?

The headache is because the former compiles using /bin/cc and
I am trying to integrate old C code with some new C++ stuff
(this is \supposed/ to work....)


	Brian 
Re: pointers to functions returning typedefs in structures (correction)
#299
Author: Brian Bershad
Date: Fri, 05 Sep 1986 07:43
37 lines
1227 bytes
---------------------------------------------------------

In a previous message I said:

>The following won't compile:

>--------------------------------
>typedef char * memory ;
>
>struct S	{
>	memory (*A)(), memory (*B)();	// this is a syntax error
};
>
>---
>but
>---
>
>struct S	{
>	memory (*A)();
>	memory (*B)();
>};
>
>
>will.


Unfortunately, the first (bad) example was not what I wanted to
say  (obviously, it won't compile)... but given:

struct S {
	memory (*A)(), (*B)();
};

(which is what I wanted to say), the compiler croaks.


	Brian 
Re: pointers to functions returning typ
#314
Author: karl
Date: Sun, 14 Sep 1986 21:49
18 lines
1139 bytes
brian@uw-june () writes:
>The following won't compile:
>    typedef char * memory ;
>    struct S {
>        memory (*A)(), memory (*B)();   // this is a syntax error
>    };

It shouldn't compile; it really *is* a syntax error.

>The headache is because the former compiles using /bin/cc and
>I am trying to integrate old C code with some new C++ stuff
>(this is \supposed/ to work....)

When I try it (oldC, SVR2 vax) I get 6 errors -- I think your /bin/cc is
broken.  That line should be written "memory (*A)(), (*B)();".

Karl W. Z. Heuer (ima!haddock!karl; karl@haddock.isc.com), The Walking Lint
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads