🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Arthur David Olson Mon, 05 Sep 1988 17:18
(void) (void)
#5324
Author: Arthur David Olson
Date: Mon, 05 Sep 1988 17:18
9 lines
409 bytes
main()
{
	(void) (void) 5;
	return 0;
}

Is the above legal ANSI code?  Should it be?
-- 
	ado@ncifcrf.gov			ADO is a trademark of Ampex.
Re: (void) (void)
#5325
Author: Doug Gwyn
Date: Tue, 06 Sep 1988 03:16
6 lines
606 bytes
In article <8131@elsie.UUCP> ado@elsie.UUCP (Arthur David Olson) writes:
>	(void) (void) 5;
>Is the above legal ANSI code?  Should it be?

It's supposed to be.  I remember the committee voting explicitly
to allow casting a void expression to void.
Re: (void) (void)
#5345
Author: T. William Wells
Date: Wed, 07 Sep 1988 13:25
17 lines
935 bytes
In article <8131@elsie.UUCP> ado@elsie.UUCP (Arthur David Olson) writes:
:       (void) (void) 5;
: Is the above legal ANSI code?  Should it be?

From section 3.2.2.2:

"The (nonexistent) value of a *void expression* (an expression
that has type _void_) shall not be used in any way, and implicit
or explicit conversions (except to _void_) shall not be applied
to such an expression."

In other words, yes: there is a specific exception in the
standard that permits this.

---
Bill
novavax!proxftl!bill
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