Project

General

Profile

Actions

Bug #6771

closed

end-of-loop code not reached in common/dnssd_clientstub.c

Added by Gary Mills over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2016-03-20
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

A build with Studio as the shadow compiler produced this error:

"../common/dnssd_clientstub.c", line 675: end-of-loop code not reached (E_END_OF_LOOP_CODE_NOT_REACHED)
cc: acomp failed for ../common/dnssd_clientstub.c

Here's the code in usr/src/lib/libdns_sd/common/dnssd_clientstub.c:

    599 static DNSServiceErrorType deliver_request(ipc_msg_hdr *hdr, DNSServiceOp *sdr)
    600 {
    ...
    633         #if defined(USE_TCP_LOOPBACK)
    ...
    651         #elif defined(USE_NAMED_ERROR_RETURN_SOCKET)
    ...
    672         #else
    673         {
    674             dnssd_sock_t sp[2];
-------------------------------------------------------------------------------
    675             if (socketpair(AF_DNSSD, SOCK_STREAM, 0, sp) < 0) deliver_request_bailout("socketpair");
-------------------------------------------------------------------------------
    676             else
    677             {
    ...
    689         #endif

The deliver_request_bailout macro is defined this way:

+ #define deliver_request_bailout(MSG) \
      do { syslog(LOG_WARNING, "dnssd_clientstub deliver_request: %s failed %d (%s)", (MSG), dnssd_errno, dnssd_strerror(dnssd_errno)); goto cleanup; } while(0)

The compiler is complaining about the jump out of the do/while loop. There are two possible solutions. One is to alter the macro by removing the loop. The other is to suppress the error by adding -erroff=E_END_OF_LOOP_CODE_NOT_REACHED to the appropriate Makefile.

Actions

Also available in: Atom PDF