Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5168

Default constructor error

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail
From Ruben Safir <ruben@mrbrklyn.com>
Newsgroups comp.lang.c++
Subject Default constructor error
Date Thu, 19 May 2011 17:14:47 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 27
Message-ID <ir3j67$486$2@reader1.panix.com> (permalink)
NNTP-Posting-Host www2.mrbrklyn.com
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace reader1.panix.com 1305825287 4358 96.57.23.82 (19 May 2011 17:14:47 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Thu, 19 May 2011 17:14:47 +0000 (UTC)
X-Blackjet Blackjet is a Yankee Fan
X-DRMisTHEFT Use GNU Linux today
X-From A Dark Cloud
X-LOCATION Brooklyn NY - Forget abou' it!
X-NYLXS Really - yah think computers are supposed to be broken?
User-Agent Pan/0.133 (House of Butterflies)
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:5168

Show key headers only | View raw


I'm getting this warning that appears in the 4.6 GCC compiler that didn't 
happen before.

the warning is 

/home/ruben/cplus/link_list_template_mysql/stats.h|45 col 42| warning: 
converting to non-pointer type ‘int’ from NULL [-Wconversion-null]

if comes from a default constructor

	 Distribution():freq(NULL), occurances(0){};



occurances is an int type, and the compiler is complaining about
occurances(0)

it goes away when I change it to 

Distribution():freq(NULL){
	occurances = 0;
};


but then it complains about freq which is of type T in a template

Ruben

Back to comp.lang.c++ | Previous | NextNext in thread | Find similar


Thread

Default constructor error Ruben Safir <ruben@mrbrklyn.com> - 2011-05-19 17:14 +0000
  Re: Default constructor error Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-19 13:46 -0400
  Re: Default constructor error Andrey Tarasevich <andreytarasevich@hotmail.com> - 2011-05-20 10:09 -0700
    Re: Default constructor error Ruben Safir <mrbrklyn@panix.com> - 2011-05-20 23:37 +0000
      Re: Default constructor error Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-21 13:25 -0400
      Re: Default constructor error drew@furrfu.invalid (Drew Lawson) - 2011-05-23 15:13 +0000

csiph-web