delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/17/03:19:19

From: Alex Vinokur <alexvn AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Option -Wunused & STL
Date: Mon, 17 Sep 2001 10:11:01 +0200
Organization: Scopus Network Technologies
Lines: 52
Message-ID: <3BA5B015.50082C4D@bigfoot.com>
NNTP-Posting-Host: gateway.scopus.co.il (194.90.203.161)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1000710679 11433113 194.90.203.161 (16 [79865])
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

=========================================================
gpp : GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp)
        compiled by GNU C version 2.95.3 20010315/djgpp (release)
Windows98
=========================================================

Option -Wunused :
-Wunused                Warn when a variable is unused

It seems the option doesn't detect unused variables of STL-types.


######### x1.c ##########
#include <string>
#include <vector>
#include <list>
int main ()
{
//--------
string  s1;
vector<int> v1;
list<int> l1;
//--------
int  i1;
char  c1;
float  f1;

  return 0;
}

#########################


####### Compiling #######
%gpp -Wunused x1.c
x1.c: In function `int main()':
x1.c:13: warning: unused variable `float f1'
x1.c:12: warning: unused variable `char c1'
x1.c:11: warning: unused variable `int i1'
#########################


  ===========================
  Alex Vinokur
    mailto:alexvn AT bigfoot DOT com
    mailto:alexvn AT dr DOT com
    http://up.to/alexvn
    http://go.to/alexv_math
  ===========================


- Raw text -


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