[PATCH] libdtrace: Fix switch statement errors for older compilers

Alan Maguire <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <[email protected]>
For older gcc we see

CC: libdtrace/dt_btf.c
libdtrace/dt_btf.c: In function ‘dt_btf_func_is_traceable’:
libdtrace/dt_btf.c:1053:3: error: label at end of compound statement
   default:
   ^~~~~~~
libdtrace/dt_btf.c:1081:4: error: label at end of compound statement
    default:
    ^~~~~~~
make: *** [Makerules:14: /home/almagui/src/dtrace/build/libdtrace--dt_btf.o] Error 1

This is because a statement is required in the default: label.
Add a break statement to suppress the error.

Signed-off-by: Alan Maguire <[email protected]>
---
 libdtrace/dt_btf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libdtrace/dt_btf.c b/libdtrace/dt_btf.c
index 1f793397..9715cc3f 100644
--- a/libdtrace/dt_btf.c
+++ b/libdtrace/dt_btf.c
@@ -1052,6 +1052,7 @@ dt_btf_func_is_traceable(dtrace_hdl_t *dtp, const dt_btf_t *btf, uint32_t id)
 			return 0;
 		default:
 			/* fall-through */
+			break;
 		}
 	}
 
@@ -1080,6 +1081,7 @@ dt_btf_func_is_traceable(dtrace_hdl_t *dtp, const dt_btf_t *btf, uint32_t id)
 					return 0;
 			default:
 				/* fall-through */
+				break;
 			}
 		}
 	}
-- 
2.43.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.