Skip to contentSkip to conversation

cmd/ethsw: Disable implicit enum conversion warning

PATCH In review Tom Rini 2 participants 3 messages May 28, 2017 – Jun 6, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 cmd/ethsw: Disable implicit enum conversion warning

With clang-3.8 we see warnings like:
cmd/ethsw.c:304:6: warning: implicit conversion from
enumeration type 'enum ethsw_keyword_opt_id' to different enumeration type 'enum ethsw_keyword_id' [-Wenum-conversion]
ethsw_id_pvid_no, ^~~~~~~~~~~~~~~~

Because we have one enum for ethsw_keyword_id and a second enum for ethsw_keyword_opt_id. This ends up being safe as ethsw_keyword_opt_id
explicitly starts after ethsw_keyword_id enum ends. Disable the
warning here rather than collapse these into one enum and rely on comments to denote where optional keywords begin.

Cc Codrin Ciubotariu <[email protected]>
Cc Joe Hershberger <[email protected]>
---
 cmd/Makefile | 2 ++
 1 file changed, 2 insertions(+)
cmd/Makefile +2 -0
index 9ea56e99778a..b92e42df32e6 100644
@@ -192,3 +192,5 @@ $(obj)/license_data_gz.h: $(obj)/license_data.gz FORCE
 targets += license_data_size.h
 $(obj)/license_data_size.h: $(srctree)/Licenses/gpl-2.0.txt FORCE
 	$(call filechk,data_size)
+
+CFLAGS_ethsw.o := -Wno-enum-conversion
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 cmd/ethsw: Disable implicit enum conversion warning

Quoted 13 lines · Tom Rini

With clang-3.8 we see warnings like:
cmd/ethsw.c:304:6: warning: implicit conversion from
enumeration type 'enum ethsw_keyword_opt_id' to different enumeration type 'enum ethsw_keyword_id' [-Wenum-conversion]
ethsw_id_pvid_no, ^~~~~~~~~~~~~~~~

Because we have one enum for ethsw_keyword_id and a second enum for ethsw_keyword_opt_id. This ends up being safe as ethsw_keyword_opt_id
explicitly starts after ethsw_keyword_id enum ends. Disable the
warning here rather than collapse these into one enum and rely on comments to denote where optional keywords begin.

Quoted 3 lines
Cc Codrin Ciubotariu <[email protected]>
Cc Joe Hershberger <[email protected]>
author
#2 lore raw
In reply to Tom Rini
Quoted 13 lines · Tom Rini

With clang-3.8 we see warnings like:
cmd/ethsw.c:304:6: warning: implicit conversion from
enumeration type 'enum ethsw_keyword_opt_id' to different enumeration type 'enum ethsw_keyword_id' [-Wenum-conversion]
ethsw_id_pvid_no, ^~~~~~~~~~~~~~~~

Because we have one enum for ethsw_keyword_id and a second enum for ethsw_keyword_opt_id. This ends up being safe as ethsw_keyword_opt_id
explicitly starts after ethsw_keyword_id enum ends. Disable the
warning here rather than collapse these into one enum and rely on comments to denote where optional keywords begin.

Quoted 4 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170605/bdc42a99/attachment.sig>