public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Is *& Legal?
@ 1999-11-09  9:02 Erik Berry
  1999-11-09  9:18 ` Eric Ladner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Erik Berry @ 1999-11-09  9:02 UTC (permalink / raw)
  To: help-gcc

  Some compilers allow function definitions like this in header files:

int my_function(char *&next);

  Is the *& construct legal in strict ANSI C?  If so, is there a way to 
coax gcc (GNU c compiler) to accept this syntax?  Apparently some HP/SUN 
compilers accept this by default, but gcc doesn't.

Thanks,
Erik

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

* Re: Is *& Legal?
  1999-11-09  9:02 Is *& Legal? Erik Berry
@ 1999-11-09  9:18 ` Eric Ladner
  1999-11-30 23:28   ` Eric Ladner
  1999-11-09 23:44 ` Martin Kahlert
  1999-11-30 23:28 ` Erik Berry
  2 siblings, 1 reply; 6+ messages in thread
From: Eric Ladner @ 1999-11-09  9:18 UTC (permalink / raw)
  To: Erik Berry; +Cc: help-gcc

Erik Berry wrote:

>   Some compilers allow function definitions like this in header files:
>
> int my_function(char *&next);
>
>   Is the *& construct legal in strict ANSI C?  If so, is there a way to
> coax gcc (GNU c compiler) to accept this syntax?  Apparently some HP/SUN
> compilers accept this by default, but gcc doesn't.
>
> Thanks,
> Erik

You may just need to add parens to avoid order of operations confusion
between different compilers.

Eric

--
================================================================
Eric Ladner              | HPUX Systems Admin, Oracle DBA
Pascagoula Refinery      | Java Programmer, Perl scripter, C++
Chevron Products Company | programmer, etc., etc., etc.


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

* Re: Is *& Legal?
  1999-11-09  9:02 Is *& Legal? Erik Berry
  1999-11-09  9:18 ` Eric Ladner
@ 1999-11-09 23:44 ` Martin Kahlert
  1999-11-30 23:28   ` Martin Kahlert
  1999-11-30 23:28 ` Erik Berry
  2 siblings, 1 reply; 6+ messages in thread
From: Martin Kahlert @ 1999-11-09 23:44 UTC (permalink / raw)
  To: help-gcc

In article < MPG.129004dc43a51770989688@news.wustl.edu >,
	Erik Berry <eberry@please.remove.aol.com> writes:
>   Some compilers allow function definitions like this in header files:
> 
> int my_function(char *&next);

Isn't that a reference to a char pointer in C++?
Perhaps you missed some ifdef c++ stuff?

Bye,
Martin.

-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.

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

* Re: Is *& Legal?
  1999-11-09  9:18 ` Eric Ladner
@ 1999-11-30 23:28   ` Eric Ladner
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Ladner @ 1999-11-30 23:28 UTC (permalink / raw)
  To: Erik Berry; +Cc: help-gcc

Erik Berry wrote:

>   Some compilers allow function definitions like this in header files:
>
> int my_function(char *&next);
>
>   Is the *& construct legal in strict ANSI C?  If so, is there a way to
> coax gcc (GNU c compiler) to accept this syntax?  Apparently some HP/SUN
> compilers accept this by default, but gcc doesn't.
>
> Thanks,
> Erik

You may just need to add parens to avoid order of operations confusion
between different compilers.

Eric

--
================================================================
Eric Ladner              | HPUX Systems Admin, Oracle DBA
Pascagoula Refinery      | Java Programmer, Perl scripter, C++
Chevron Products Company | programmer, etc., etc., etc.


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

* Is *& Legal?
  1999-11-09  9:02 Is *& Legal? Erik Berry
  1999-11-09  9:18 ` Eric Ladner
  1999-11-09 23:44 ` Martin Kahlert
@ 1999-11-30 23:28 ` Erik Berry
  2 siblings, 0 replies; 6+ messages in thread
From: Erik Berry @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

  Some compilers allow function definitions like this in header files:

int my_function(char *&next);

  Is the *& construct legal in strict ANSI C?  If so, is there a way to 
coax gcc (GNU c compiler) to accept this syntax?  Apparently some HP/SUN 
compilers accept this by default, but gcc doesn't.

Thanks,
Erik

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

* Re: Is *& Legal?
  1999-11-09 23:44 ` Martin Kahlert
@ 1999-11-30 23:28   ` Martin Kahlert
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Kahlert @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

In article < MPG.129004dc43a51770989688@news.wustl.edu >,
	Erik Berry <eberry@please.remove.aol.com> writes:
>   Some compilers allow function definitions like this in header files:
> 
> int my_function(char *&next);

Isn't that a reference to a char pointer in C++?
Perhaps you missed some ifdef c++ stuff?

Bye,
Martin.

-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.

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

end of thread, other threads:[~1999-11-30 23:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-09  9:02 Is *& Legal? Erik Berry
1999-11-09  9:18 ` Eric Ladner
1999-11-30 23:28   ` Eric Ladner
1999-11-09 23:44 ` Martin Kahlert
1999-11-30 23:28   ` Martin Kahlert
1999-11-30 23:28 ` Erik Berry

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 read-only IMAP folder(s) and NNTP newsgroup(s).