For CRAN submission, remove all #pragma's that suppress compiler warnings (#3329)
* For CRAN submission, remove all #pragma's that suppress compiler warnings A few headers in dmlc-core contain #pragma's that disable compiler warnings, which is against the CRAN submission policy. Fix the problem by removing the offending #pragma's as part of the command `make Rbuild`. This addresses issue #3322. * Fix script to improve Cygwin/MSYS compatibility We need this to pass rmingw CI test * Remove remove_warning_suppression_pragma.sh from packaged tarball
This commit is contained in:
parent
d367e4fc6b
commit
71e226120a
2
Makefile
2
Makefile
@ -261,6 +261,8 @@ Rpack: clean_all
|
||||
cat R-package/src/Makevars.in|sed '2s/.*/PKGROOT=./' | sed '3s/.*/ENABLE_STD_THREAD=0/' > xgboost/src/Makevars.in
|
||||
cp xgboost/src/Makevars.in xgboost/src/Makevars.win
|
||||
sed -i -e 's/@OPENMP_CXXFLAGS@/$$\(SHLIB_OPENMP_CFLAGS\)/g' xgboost/src/Makevars.win
|
||||
bash R-package/remove_warning_suppression_pragma.sh
|
||||
rm xgboost/remove_warning_suppression_pragma.sh
|
||||
|
||||
Rbuild: Rpack
|
||||
R CMD build --no-build-vignettes xgboost
|
||||
|
||||
14
R-package/remove_warning_suppression_pragma.sh
Executable file
14
R-package/remove_warning_suppression_pragma.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# remove all #pragma's that suppress compiler warnings
|
||||
set -e
|
||||
set -x
|
||||
for file in xgboost/src/dmlc-core/include/dmlc/*.h
|
||||
do
|
||||
sed -i.bak -e 's/^.*#pragma GCC diagnostic.*$//' -e 's/^.*#pragma clang diagnostic.*$//' -e 's/^.*#pragma warning.*$//' "${file}"
|
||||
done
|
||||
for file in xgboost/src/dmlc-core/include/dmlc/*.h.bak
|
||||
do
|
||||
rm "${file}"
|
||||
done
|
||||
set +x
|
||||
set +e
|
||||
Loading…
x
Reference in New Issue
Block a user