I didn't realise that this structure is actually a message that is sent 
over the network, though. Is it sent as raw data? Shouldn't there be a 
serialization step, where we convert all members to network byte-order 
before transmitting over the network? This serialization step should 
also ensure that each field has a well-defined size, so it shouldn't 
matter what the size of the field is in the C data structure.

regards,
Anders Widell

2013-11-11 10:51, Hans Feldt skrev:
> "role" is part of a director->node-director message and encoded as 
> uint32. It should be safe to change its datatype to SaAmfHAStateT in 
> the struct and thereby get rid of both the compiler warning and the cast.
> /Hans
>
> On 11/11/2013 10:08 AM, Anders Widell wrote:
>> The "role" member is of type uint32_t. But if it really is meant to 
>> only take the values of the SaAmfHAStateT enum, then
>> its type should be changed to SaAmfHAStateT.
>>
>> regards,
>> Anders Widell
>>
>> 2013-11-07 15:37, Hans Feldt skrev:
>>> We don't want more casts but fewer! Can it be fixed in a better way?
>>> /Hans
>>>
>>> On 11/06/2013 06:46 AM, praveen malviya wrote:
>>>> Hi,
>>>> Problem occurs with old versions of GCC. It works fine with gcc 
>>>> compilers >= 4.5.0.
>>>> Here is the patch for it:
>>>>
>>>> diff --git a/osaf/services/saf/amf/amfnd/mbcsv.cc 
>>>> b/osaf/services/saf/amf/amfnd/mbcsv.cc
>>>> --- a/osaf/services/saf/amf/amfnd/mbcsv.cc
>>>> +++ b/osaf/services/saf/amf/amfnd/mbcsv.cc
>>>> @@ -1290,7 +1290,7 @@ uint32_t avnd_evt_avd_role_change_evh(AV
>>>>           prev_ha_state = cb->avail_state_avnd;
>>>>
>>>>           /* Ignore the duplicate roles. */
>>>> -       if (prev_ha_state == info->role) {
>>>> +       if (prev_ha_state == (SaAmfHAStateT)info->role) {
>>>>                   return NCSCC_RC_SUCCESS;
>>>>           }
>>>>
>>>> Thanks,
>>>> Praveen
>>>> On 05-Nov-13 6:10 PM, Sirisha Alla wrote:
>>>>> ------------------------------------------------------------------------------------------------------------------------
>>>>>  
>>>>>
>>>>>
>>>>>
>>>>> *[tickets:#616] <http://sourceforge.net/p/opensaf/tickets/616/> 
>>>>> latest staging does not compile*
>>>>>
>>>>> *Status:* unassigned
>>>>> *Created:* Tue Nov 05, 2013 12:40 PM UTC by Sirisha Alla
>>>>> *Last Updated:* Tue Nov 05, 2013 12:40 PM UTC
>>>>> *Owner:* nobody
>>>>>
>>>>> current default staging(cs 4585) does not compile with the 
>>>>> following error
>>>>>
>>>>> g++ -DHAVE_CONFIG_H -I. -I../../../../.. -DSA_CLM_B01=1 
>>>>> -I../../../../../osaf/libs/saf/include
>>>>> -I../../../../../osaf/libs/core/include 
>>>>> -I../../../../../osaf/libs/core/leap/include
>>>>> -I../../../../../osaf/libs/core/mds/include 
>>>>> -I../../../../../osaf/libs/core/common/include
>>>>> -I../../../../../osaf/libs/common/amf/include 
>>>>> -I../../../../../osaf/services/saf/amf/amfnd/include
>>>>> -I../../../../../osaf/libs/common/immsv/include -Wall 
>>>>> -fno-strict-aliasing -Werror -fPIC -D__STDC_FORMAT_MACROS -O2 -g
>>>>> -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector 
>>>>> -funwind-tables -fasynchronous-unwind-tables -MT
>>>>> osafamfnd-mbcsv.o -MD -MP -MF .deps/osafamfnd-mbcsv.Tpo -c -o 
>>>>> osafamfnd-mbcsv.o |test -f 'mbcsv.cc' || echo
>>>>> './'|mbcsv.cc
>>>>> cc1plus: warnings being treated as errors
>>>>> mbcsv.cc: In function ‘uint32_t 
>>>>> avnd_evt_avd_role_change_evh(AVND_CB/, AVND_EVT/)’:
>>>>> mbcsv.cc:1293: error: comparison between signed and unsigned 
>>>>> integer expressions
>>>>> make[8]: */[osafamfnd-mbcsv.o] Error 1
>>>>> make[8]: Leaving directory 
>>>>> |/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf/services/saf/amf/amfnd'
>>>>> make[7]: *** [all-recursive] Error 1 make[7]: Leaving
>>>>> directory|/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf/services/saf/amf/amfnd'
>>>>>  
>>>>>
>>>>> make[6]: /* [all-recursive] Error 1
>>>>> make[6]: Leaving directory 
>>>>> |/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf/services/saf/amf'
>>>>>  
>>>>> make[5]: ***
>>>>> [all-recursive] Error 1 make[5]: Leaving
>>>>> directory|/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf/services/saf'
>>>>>  
>>>>>
>>>>> make[4]: */[all-recursive] Error 1
>>>>> make[4]: Leaving directory 
>>>>> |/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf/services' 
>>>>> make[3]: ***
>>>>> [all-recursive] Error 1 make[3]: Leaving 
>>>>> directory|/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0/osaf' 
>>>>>
>>>>> make[2]: /* [all-recursive] Error 1
>>>>> make[2]: Leaving directory 
>>>>> |/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0' make[1]: 
>>>>> *** [all] Error 2
>>>>> make[1]: Leaving 
>>>>> directory|/home/sirisha/staging_nov5th/rpms/BUILD/opensaf-4.4.M0'
>>>>> error: Bad exit status from 
>>>>> /home/sirisha/staging_nov5th/rpms/tmp/rpm-tmp.10997 (%build)
>>>>>
>>>>> RPM build errors:
>>>>> Bad exit status from 
>>>>> /home/sirisha/staging_nov5th/rpms/tmp/rpm-tmp.10997 (%build)
>>>>> make: *** [rpm] Error 1
>>>>>
>>>>> ------------------------------------------------------------------------------------------------------------------------
>>>>>  
>>>>>
>>>>>
>>>>>
>>>>> Sent from sourceforge.net because 
>>>>> [email protected] is subscribed to
>>>>> https://sourceforge.net/p/opensaf/tickets/
>>>>>
>>>>> To unsubscribe from further messages, a project admin can change 
>>>>> settings at
>>>>> https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if 
>>>>> this is a mailing list, you can unsubscribe from the
>>>>> mailing list.
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>>  
>>>>>
>>>>> November Webinars for C, C++, Fortran Developers
>>>>> Accelerate application performance with scalable programming 
>>>>> models. Explore
>>>>> techniques for threading, error checking, porting, and tuning. Get 
>>>>> the most
>>>>> from the latest Intel processors and coprocessors. See abstracts 
>>>>> and register
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>>>>>  
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Opensaf-tickets mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/opensaf-tickets
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>  
>>>>
>>>> November Webinars for C, C++, Fortran Developers
>>>> Accelerate application performance with scalable programming 
>>>> models. Explore
>>>> techniques for threading, error checking, porting, and tuning. Get 
>>>> the most
>>>> from the latest Intel processors and coprocessors. See abstracts 
>>>> and register
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
>>>>  
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Opensaf-tickets mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/opensaf-tickets
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>>  
>>>
>>> November Webinars for C, C++, Fortran Developers
>>> Accelerate application performance with scalable programming models. 
>>> Explore
>>> techniques for threading, error checking, porting, and tuning. Get 
>>> the most
>>> from the latest Intel processors and coprocessors. See abstracts and 
>>> register
>>> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk 
>>>
>>> _______________________________________________
>>> Opensaf-tickets mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/opensaf-tickets
>>>
>>>
>>
>>
>>
>>
>
>
>



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to