question about build warning

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
Post Reply
wendallsan
Posts: 45
Joined: 10 Dec 2017

09 Jul 2021

I've been getting build warnings that I've ignored until now as the builds complete in spite of the warnings. All the warnings seem to be coming from my constructor and seem to do with the order in which fields are being initialized, but I don't really know what to do about it prevent the warnings. My constructor is empty other than the field initializations:

Code: Select all

CMyPlugin::CMyPlugin( TJBox_Float32 iSampleRate ) :
  fCustomProps( JBox_GetMotherboardObjectRef( "/custom_properties" ) ),
  fNoteStates( JBox_GetMotherboardObjectRef( "/note_states" ) ),
  fGateInCVJackRef( JBox_GetMotherboardObjectRef( "/cv_inputs/gate_cv" ) ),
  fGateOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/gate_out" ) ),
  fTriggerOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/trigger_out" ) ),
  fNoteOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/note_out" ) ),
  fTriggerNoteOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/trigger_note_out" ) ),
  fSampleRate( iSampleRate ),
  fSecondsUntilGateInOutLampTurnOff( -1.f ),
  fSecondsUntilTriggerTurnOff( -1.f ),
  fGateInOutLampIsOnPropertyRef( JBox_MakePropertyRef( fCustomProps, "gateInOutLampIsOn" ) ),
  fTriggerOutLampIsOnPropertyRef( JBox_MakePropertyRef( fCustomProps, "triggerOutLampIsOn" ) ),
  fNotesArePressedPropertyRef( JBox_MakePropertyRef( fCustomProps, "notesArePressed" ) ),
  fTriggerNotePropertyRef( JBox_MakePropertyRef( fCustomProps, "triggerNote" ) ),
  fGateInConnectedCVInputRef( JBox_MakePropertyRef( fGateInCVJackRef, "connected" ) ),
  fGateInValuePropertyRef( JBox_MakePropertyRef( fGateInCVJackRef, "value" ) ),
  fNoteOutCVJackValuePropertyRef( JBox_MakePropertyRef( fNoteOutCVJackRef, "value" ) ),
  fGateOutCVJackValuePropertyRef( JBox_MakePropertyRef( fGateOutCVJackRef, "value" ) ),	
  fTriggerOutCVJackValuePropertyRef( JBox_MakePropertyRef( fTriggerOutCVJackRef, "value" ) ),
  fTriggerNoteOutCVJackValuePropertyRef( JBox_MakePropertyRef( fTriggerNoteOutCVJackRef, "value" ) ),
  fNewNotePropertyRef( JBox_MakePropertyRef( fCustomProps, "newNote" ) ),
  fNewTriggerPropertyRef( JBox_MakePropertyRef( fCustomProps, "newTrigger" ) ),
  fNewTrigger( false ),
  fNewGate( false ),
  fLastGateCV( 0 ),
  fNoteCV( 0.f )
{}
Here are the warnings that I'm seeing:

Code: Select all

MyPlugin.cpp(13,2):  warning: field 'fGateOutCVJackRef' will be initialized after field 'fTriggerOutCVJackRef'
        fGateOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/gate_out" ) ),
        ^
MyPlugin.cpp(16,2):  warning: field 'fTriggerNoteOutCVJackRef' will be initialized after field 'fSampleRate'
        fTriggerNoteOutCVJackRef( JBox_GetMotherboardObjectRef( "/cv_outputs/trigger_note_out" ) ),
        ^
MyPlugin.cpp(23,2):  warning: field 'fTriggerNotePropertyRef' will be initialized after field 'fGateInConnectedCVInputRef'
        fTriggerNotePropertyRef( JBox_MakePropertyRef( fCustomProps, "triggerNote" ) ),
        ^
MyPlugin.cpp(28,2):  warning: field 'fTriggerOutCVJackValuePropertyRef' will be initialized after field 'fTriggerNoteOutCVJackValuePropertyRef'
        fTriggerOutCVJackValuePropertyRef( JBox_MakePropertyRef( fTriggerOutCVJackRef, "value" ) ),
        ^
MyPlugin.cpp(33,2):  warning: field 'fNewGate' will be initialized after field 'fLastGateCV'
        fNewGate( false ),
        ^
5 warnings generated.
Is there a way to prevent these warnings or should I just continue to ignore them? Thanks for any help!

wendallsan
Posts: 45
Joined: 10 Dec 2017

09 Jul 2021

Sorted! I need to order my field initializations to match the order that they're declared in my .h file.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests