mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Set CXXFLAGS in-line with current CFLAGS settings (autoconf)
Also, replaced #define _GNU_SOURCE (in config.h) with -D_GNU_SOURCE command-line parameter because, for some reason g++ defines it implicitly and then complains about multiple definitions. Also, removed -Winline from C(XX)FLAGS because it causes a lot of warnings for c++ code that can't be easily removed and are not very significant.
This commit is contained in:
parent
78da8a1946
commit
2790d35e06
@ -24,7 +24,7 @@ if test x"$CFLAGS" = x""; then
|
||||
AC_SUBST(CFLAGS, [ ])
|
||||
fi
|
||||
|
||||
AC_DEFINE([_GNU_SOURCE], [], [Define for GNU source and extensions])
|
||||
conky_CFLAGS="$conky_CFLAGS -D_GNU_SOURCE"
|
||||
|
||||
dnl
|
||||
dnl Tools
|
||||
@ -916,10 +916,10 @@ AC_ARG_ENABLE([testing],
|
||||
|
||||
if test "x$want_testing" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
|
||||
if test "x$want_debug" = "xyes"; then
|
||||
conky_CFLAGS="$conky_CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
|
||||
conky_CFLAGS="$conky_CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
|
||||
AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
|
||||
else
|
||||
conky_CFLAGS="$conky_CFLAGS -O0 -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
|
||||
conky_CFLAGS="$conky_CFLAGS -O0 -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
|
||||
AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
|
||||
fi
|
||||
fi
|
||||
@ -941,7 +941,16 @@ if test "x$want_profiling" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
|
||||
AC_DEFINE([PROFILING], [], [Define for profiling (gprof and gcov) support])
|
||||
fi
|
||||
|
||||
conky_CXXFLAGS=$conky_CFLAGS
|
||||
#remove C-only options
|
||||
conky_CXXFLAGS=${conky_CXXFLAGS/-Wdeclaration-after-statement/}
|
||||
conky_CXXFLAGS=${conky_CXXFLAGS/-Wbad-function-cast/}
|
||||
conky_CXXFLAGS=${conky_CXXFLAGS/-Wstrict-prototypes/}
|
||||
conky_CXXFLAGS=${conky_CXXFLAGS/-Wold-style-definition/}
|
||||
conky_CXXFLAGS=${conky_CXXFLAGS/-std=c99/-std=c++98}
|
||||
|
||||
AC_SUBST(conky_CFLAGS)
|
||||
AC_SUBST(conky_CXXFLAGS)
|
||||
AC_SUBST(conky_LIBS)
|
||||
AC_SUBST(X11_LIBS)
|
||||
|
||||
@ -957,6 +966,7 @@ $PACKAGE $VERSION configured successfully:
|
||||
Installing into: $prefix
|
||||
System config dir: $sysconfdir
|
||||
C compiler flags: $conky_CFLAGS
|
||||
C++ compiler flags:$conky_CXXFLAGS
|
||||
Libraries: $conky_LIBS
|
||||
Linker flags: $conky_LDFLAGS
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "conky.h"
|
||||
#define _GNU_SOURCE
|
||||
#include "algebra.h"
|
||||
#include "logging.h"
|
||||
#include <ctype.h>
|
||||
|
@ -396,7 +396,7 @@ int peek_tcp_port_monitor(const tcp_port_monitor_t *p_monitor, int item,
|
||||
|
||||
/* if the connection index is out of range, we simply return with no error,
|
||||
* having first cleared the client-supplied buffer. */
|
||||
if ((item != COUNT) && (connection_index >= p_monitor->hash.size())) {
|
||||
if ( (item != COUNT) && (connection_index >= ssize_t(p_monitor->hash.size())) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -404,7 +404,7 @@ int peek_tcp_port_monitor(const tcp_port_monitor_t *p_monitor, int item,
|
||||
|
||||
case COUNT:
|
||||
|
||||
std::snprintf(p_buffer, buffer_size, "%zd", p_monitor->hash.size());
|
||||
std::snprintf(p_buffer, buffer_size, "%u", unsigned(p_monitor->hash.size()));
|
||||
break;
|
||||
|
||||
case REMOTEIP:
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include "config.h"
|
||||
#include "common.h"
|
||||
#include "text_object.h"
|
||||
#include "logging.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include "config.h"
|
||||
#include "text_object.h"
|
||||
#include "logging.h"
|
||||
#include <stdlib.h>
|
||||
|
Loading…
Reference in New Issue
Block a user