www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/11/11:20:00

Date: Fri, 11 Apr 1997 11:01:28 -0400 (EDT)
From: Michael Phelps <morphine AT hops DOT cs DOT jhu DOT edu>
To: Chris Croughton <crough45 AT amc DOT de>
cc: max AT alcyone DOT com, djgpp AT delorie DOT com
Subject: Re: funny re user-defined ++ and -- operators
In-Reply-To: <97Apr11.122200gmt+0100.21891@internet01.amc.de>
Message-ID: <Pine.GSO.3.95.970411105923.21960A-100000@hops.cs.jhu.edu>
MIME-Version: 1.0

On Fri, 11 Apr 1997, Chris Croughton wrote:

> 
> Erik Max Francis wrote:
> 
> >These are legitimate warnings (probably they should be errors, though); you
> >haven't defnied a postfix operator ++ or operator --.  To distinguish
> >between postfix and prefix operators, define them as taking an argument of
> >type int (you never have to use it).
> 
> I have a philosophical objection to having unused arguments.  It
> comes from many years of compilers and lint complaining about
> unused arguments (so much so that I have a standard
> 
> #define NOTUSED(x)  (x=x)
> 
> to satisfy compilers - it's usually optimised out but generally
> after it has suppressed the warning).
> 
> Chris
> 

In C++ you can have a parameter that is basically declared to be ignored.
Simply declare the data type without a corresponding variable:
	double	example_function(double x, int, int, long y)
	{
		// Function body
	}

The compiler knows that you don't want to use it.



						---Michael Phelps
						   morphine AT cs DOT jhu DOT edu


                               CH3
                               |
                               N
                             / |
                     ______/   |
                    /      \   CH2
             _____/         \__|__      
           //     \\        /  |  \\     
         //        \\______/___CH2 \\  
          \        /       \       /
           \______/         \_____/
          / ------ \       /      \
        OH           \   /         OH
                       O
 
                   Morphine



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019