From 97a585876e728f80f43ab389448699d290cfa8c3 Mon Sep 17 00:00:00 2001 From: dim Date: Tue, 21 Feb 2012 20:55:43 +0000 Subject: [PATCH] When building with clang, disable -Wunneeded-internal-declaration for several sys/cam/ctl files, since these get the following warnings: In file included from sys/cam/ctl/ctl_backend.c:60: sys/cam/ctl/ctl_private.h:300:30: error: variable 'page_index_template' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static struct ctl_page_index page_index_template[] = { ^ These warnings are tricky to fix without a lot of overhaul, and they are harmless, so disable them for now. MFC after: 1 week --- sys/conf/files | 15 ++++++++++----- sys/conf/kern.mk | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index b8c2261085f..83a833df5a4 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -116,16 +116,21 @@ cam/scsi/scsi_cd.c optional cd cam/scsi/scsi_ch.c optional ch cam/ata/ata_da.c optional ada | da cam/ctl/ctl.c optional ctl -cam/ctl/ctl_backend.c optional ctl +cam/ctl/ctl_backend.c optional ctl \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" cam/ctl/ctl_backend_block.c optional ctl cam/ctl/ctl_backend_ramdisk.c optional ctl -cam/ctl/ctl_cmd_table.c optional ctl -cam/ctl/ctl_frontend.c optional ctl +cam/ctl/ctl_cmd_table.c optional ctl \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" +cam/ctl/ctl_frontend.c optional ctl \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" cam/ctl/ctl_frontend_cam_sim.c optional ctl -cam/ctl/ctl_frontend_internal.c optional ctl +cam/ctl/ctl_frontend_internal.c optional ctl \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" cam/ctl/ctl_mem_pool.c optional ctl cam/ctl/ctl_scsi_all.c optional ctl -cam/ctl/ctl_error.c optional ctl +cam/ctl/ctl_error.c optional ctl \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" cam/ctl/ctl_util.c optional ctl cam/ctl/scsi_ctl.c optional ctl cam/scsi/scsi_da.c optional da diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index d561aaeff36..5ca83ac36bf 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -22,6 +22,7 @@ NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WUNUSED_VALUE= -Wno-unused-value NO_WSELF_ASSIGN= -Wno-self-assign +NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. -- 2.45.0