提交 1919e355 编写于 作者: M Michal Privoznik

cfg.mk: Introduce rule for setlocale()

In the past we had some issues where setlocale() was called without
corresponding include of locale.h. While on some systems this may
work, on others the compilation failed. We should have a syntax-check
rule for that to prevent this from happening again.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3289edd2
...@@ -929,6 +929,15 @@ sc_prohibit_mixed_case_abbreviations: ...@@ -929,6 +929,15 @@ sc_prohibit_mixed_case_abbreviations:
halt='Use PCI, USB, SCSI, not Pci, Usb, Scsi' \ halt='Use PCI, USB, SCSI, not Pci, Usb, Scsi' \
$(_sc_search_regexp) $(_sc_search_regexp)
# Require #include <locale.h> in all files that call setlocale()
sc_require_locale_h:
@for i in $$($(VC_LIST_EXCEPT) | grep '\.[chx]$$'); do \
if ! grep -q setlocale\( $$i ; then continue; fi ; \
if ! grep -q '# *include <locale.h>' $$i ; then \
echo '$(ME): missing locale.h include in' $$i 1>&2; exit 1; \
fi; \
done;
# We don't use this feature of maint.mk. # We don't use this feature of maint.mk.
prev_version_file = /dev/null prev_version_file = /dev/null
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册