tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* C++ question; strange warning
@ 2001-11-08  4:01 Noboom2
  0 siblings, 0 replies; only message in thread
From: Noboom2 @ 2001-11-08  4:01 UTC (permalink / raw)
  To: tru64-unix-managers

A little C++ question here.  Hopefully, there are a few programmers still out 
there
using it. :)

I'm getting the following warning when I compile this program.  Can anyone 
explain
why? More importantly, how can I eliminate the warning (besides disabling it 
on the
compile command line)?  

Thanks in advance for any assistance.

------------------------------------------------------------------------------

------------------------

% cat d.C
#include <iostream>
#include <stdlib.h>

struct t {
        int turn;               
};

void clearit( t b ) {
        b.turn = 0;
}

int main() {
        t game;
        clear( game );  
        return EXIT_SUCCESS;
}
% cxx -V
Compaq C++ V6.3-014 for Digital UNIX V4.0D  (Rev. 878)
Compiler Driver V6.3-014 (cxx) cxx Driver
% cxx d.C
cxx: Warning: d.C, line 22: variable "game.turn" is fetched, not initialized
        clearit( game );  
--------^
% 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-08  4:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-08  4:01 C++ question; strange warning Noboom2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox