G++ compile/link warning

The engine.
Post Reply
bernt
Posts: 5
Joined: Wed Sep 18, 2013 10:27 am

G++ compile/link warning

Post by bernt »

Dear List

I am building an application in C++ using SMILE lib.
Using RedHat Linuc and GCC.

Getting these warnings when I compile a simple program.
Anyone knows why, and how to get rid of them?

----
lib/simplecase.h: In constructor 'DSL_simpleCase::Item::Item(int)':
lib/simplecase.h:109: warning: 'DSL_simpleCase::Item::continous' will be initialized after
lib/simplecase.h:107: warning: 'int DSL_simpleCase::Item::type'
lib/simplecase.h:105: warning: when initialized here
---
Thanx..

./Bernt
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: G++ compile/link warning

Post by shooltz[BayesFusion] »

bernt wrote:Getting these warnings when I compile a simple program.
Anyone knows why, and how to get rid of them?
This warning is a false positive. You can edit the simplecase.h and reorder the initializers in line 105 and move the initizer for 'type', so the line reads like this:

Code: Select all

Item(int h) : handle(h), type(-1), discrete(-1), continous(0) {}
Since we didn't get this warning during the build, make sure you're using the version of the compiler indicated at SMILE download page; otherwise you'll be entering the land of undefined behavior.
bernt
Posts: 5
Joined: Wed Sep 18, 2013 10:27 am

Re: G++ compile/link warning

Post by bernt »

Dear Shooltz,

Thank you for your reply.

./Bernt
Post Reply