Menu

#1340 osaf: Build fails with GCC 5.1.0

4.5.2
fixed
None
defect
osaf
-
4.7.M0
minor
2015-05-08
2015-04-24
No

OpenSAF fails to build with GCC 5.1.0, due to new compiler warnings:

imma_proc.c: In function 'imma_proc_increment_pending_reply':
imma_proc.c:3324:28: error: comparison of constant '255' with boolean expression is always true [-Werror=bool-compare]
  if (cl_node->replyPending < 0xff) {
                            ^
imma_proc.c: In function 'imma_proc_decrement_pending_reply':
imma_proc.c:3337:29: error: comparison of constant '255' with boolean expression is always true [-Werror=bool-compare]
   if (cl_node->replyPending < 0xff) {
                             ^

susm.cc: In function 'uint32_t avnd_evt_avd_su_pres_evh(AVND_CB*, AVND_EVT*)':
susm.cc:1237:26: error: switch condition has type bool [-Werror=switch-bool]
  switch (info->term_state) {
                          ^

mds_dt_tipc.c: In function 'mdtm_tipc_init':
mds_dt_tipc.c:245:28: error: comparison of constant '2' with boolean expression is always false [-Werror=bool-compare]
  if (mds_use_network_order == NCSCC_RC_FAILURE) {
                            ^

plms_hsm.c: In function 'hsm_discover_and_dispatch':
plms_hsm.c:685:20: error: unused variable 'my_entity_path' [-Werror=unused-variable]
  SaHpiEntityPathT  my_entity_path;
                    ^
plms_hsm.c:684:20: error: unused variable 'hpirc' [-Werror=unused-variable]
  SaErrorT          hpirc = SA_OK;
                    ^

Related

Tickets: #1340
Wiki: ChangeLog-4.5.2
Wiki: ChangeLog-4.6.1

Discussion

  • Anders Bjornerstedt

    The imma_proc.c warning/error is a serious bug.

    At some point cl_node->replyPending was changed from an uint8 to a bool.
    What was not considered at that time was that this member is not just used for synchronous downcalls
    And reply, but also for the asynchronous om-admin-op downcall and its corresponding om side admin-op-reply-callback.

    Although not many applications use the asynchronous admin-op API, the ones who do may encounter resurrect problems.
    probably of both kinds, i.e. not invalidating a handle that should be invalidated because IMMND broke contact when not all
    asynchronous requests had been replied to; and possibly also unnecessary failure to resurrect due to the unclear effect of repeated decrement
    on a Boolean.

    Should be a separate ticket on imam lib.

    /AndersBj

    From: Anders Widell [mailto:anders-w@users.sf.net]
    Sent: den 24 april 2015 13:38
    To: opensaf-tickets@lists.sourceforge.net
    Subject: [tickets] [opensaf:tickets] #1340 osaf: Build fails with GCC 5.1.0


    [tickets:#1340]http://sourceforge.net/p/opensaf/tickets/1340 osaf: Build fails with GCC 5.1.0

    Status: accepted
    Milestone: 4.5.2
    Created: Fri Apr 24, 2015 11:37 AM UTC by Anders Widell
    Last Updated: Fri Apr 24, 2015 11:37 AM UTC
    Owner: Anders Widell

    OpenSAF fails to build with GCC 5.1.0, due to new compiler warnings:

    imma_proc.c: In function 'imma_proc_increment_pending_reply':

    imma_proc.c:3324:28: error: comparison of constant '255' with boolean expression is always true [-Werror=bool-compare]

    if (cl_node->replyPending < 0xff) {

                            ^
    

    imma_proc.c: In function 'imma_proc_decrement_pending_reply':

    imma_proc.c:3337:29: error: comparison of constant '255' with boolean expression is always true [-Werror=bool-compare]

    if (cl_node->replyPending < 0xff) {

                             ^
    

    susm.cc: In function 'uint32_t avnd_evt_avd_su_pres_evh(AVND_CB, AVND_EVT)':

    susm.cc:1237:26: error: switch condition has type bool [-Werror=switch-bool]

    switch (info->term_state) {

                          ^
    

    mds_dt_tipc.c: In function 'mdtm_tipc_init':

    mds_dt_tipc.c:245:28: error: comparison of constant '2' with boolean expression is always false [-Werror=bool-compare]

    if (mds_use_network_order == NCSCC_RC_FAILURE) {

                            ^
    

    plms_hsm.c: In function 'hsm_discover_and_dispatch':

    plms_hsm.c:685:20: error: unused variable 'my_entity_path' [-Werror=unused-variable]

    SaHpiEntityPathT my_entity_path;

                    ^
    

    plms_hsm.c:684:20: error: unused variable 'hpirc' [-Werror=unused-variable]

    SaErrorT hpirc = SA_OK;

                    ^
    

    Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.netopensaf-tickets@lists.sourceforge.net is subscribed to https://sourceforge.net/p/opensaf/tickets/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.

     

    Related

    Tickets: #1340
    Tickets: tickets

  • Anders Widell

    Anders Widell - 2015-04-29
    • status: accepted --> review
     
  • Anders Widell

    Anders Widell - 2015-04-29

    Ticket [#1341] was created for the IMM problem. The AMF, MDS and PLM problems will be covered by this ticket.

     

    Related

    Tickets: #1341

  • Anders Widell

    Anders Widell - 2015-05-08
    • status: review --> fixed
     

Log in to post a comment.