tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Noboom2 () aol ! com
To: tru64-unix-managers
Subject: C++ question; strange warning
Date: Thu, 08 Nov 2001 04:01:56 +0000	[thread overview]
Message-ID: <102653643321650.tru64-unix-managers.marc@archive.invalid> (raw)

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 );  
--------^
% 

                 reply	other threads:[~2001-11-08  4:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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