TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: NEIL HELLER
from: DARIN MCBRIDE
date: 1998-01-20 08:51:00
subject: WARNING MESSAGE - 2

 NH> void
 NH> rc_select_slave(HANDLE hwnd_rec, LPSTR rid)
 NH> {
 NH>      error_message(NULL,"Not here");
 NH> }
 NH> The two warning messages I get are that neither hwnd_rec nor rid are
 NH> referenced in the function.  Very nice, thank you.  However, I would
 NH> like to completely eliminate these warning messages.  Any ideas?
In C++ mode, merely don't put in the variable names.  i.e.:
void rc_select_slave(HANDLE, LPSTR)
{
   error_message(NULL, "Not here");
}
In C, it's kinda not possible.  C doesn't know about overloading or virtual 
call tables, so it can't understand why you'd have parameters that aren't 
used.  That hasn't stopped workarounds from cropping up.
For example, Borland uses a pragma.  I can't remember which one - I think it 
is #pragma argused or something like that.  Just put the pragma before the 
function - it only applies to the next function.  Another method is via:
#define NOTUSED(x) x
void rc_select_slave(HANDLE h, LPSTR r)
{
  NOTUSED(h);
  NOTUSED(r);
  error_message(NULL, "Not here");
}
Most compilers will merely optimize away the first two lines there, but not 
until after figuring out that h and r are in use.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.