Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the build with --enable-xrdpdebug and CFLAGS=-Werror -Wall #1640

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ max_amd64_conf: &max_amd64_conf
packages:
- *max_amd64_deps

max_debug_amd64_conf: &max_debug_amd64_conf
env:
- CONF_FLAGS="--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame
--enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter
--enable-pixman --enable-xrdpdebug"
- DISTCHECK=1
addons:
apt:
packages:
- *max_amd64_deps

max_x86_deps: &max_x86_deps
- *common_deps
- g++-multilib
Expand Down Expand Up @@ -123,6 +134,10 @@ matrix:
- compiler: clang
<< : *max_amd64_conf

# Maximal debug amd64 build
- compiler: gcc
<< : *max_debug_amd64_conf

# Maximal x86 build
- compiler: gcc
<< : *max_x86_conf
Expand All @@ -139,5 +154,5 @@ matrix:
script:
- ./bootstrap
- ./configure $CONF_FLAGS
- make CFLAGS="$CFLAGS -O2 -Wall -Wwrite-strings -Werror"
- make CFLAGS="$CFLAGS"
- test -z "$DISTCHECK" || make distcheck
2 changes: 2 additions & 0 deletions common/pixman-region.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@

#ifdef XRDP_DEBUG

pixman_bool_t PREFIX(_selfcheck) (region_type_t *reg);

#define GOOD(reg) \
do \
{ \
Expand Down
23 changes: 13 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ AC_CONFIG_SUBDIRS([libpainter librfxcodec])
# Use silent rules by default if supported by Automake
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AX_CFLAGS_WARN_ALL
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
AX_GCC_FUNC_ATTRIBUTE([format])
AX_TYPE_SOCKLEN_T

case $host_os in
*linux*)
linux=yes
Expand Down Expand Up @@ -155,6 +150,19 @@ AC_ARG_ENABLE(rdpsndaudin, AS_HELP_STRING([--enable-rdpsndaudin],
[], [enable_rdpsndaudin=no])
AM_CONDITIONAL(XRDP_RDPSNDAUDIN, [test x$enable_rdpsndaudin = xyes])

# configure compiler options and CFLAGS
AX_GCC_FUNC_ATTRIBUTE([format])
AX_TYPE_SOCKLEN_T
AX_CFLAGS_WARN_ALL
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])

AM_COND_IF([LINUX],
[AX_APPEND_COMPILE_FLAGS([-Werror])]) # bsd has warnings that have not been fixed yet

AM_COND_IF([XRDP_DEBUG],
[AX_APPEND_COMPILE_FLAGS([-g -O0])],
[AX_APPEND_COMPILE_FLAGS([-O2])])

# Don't fail without working nasm if rfxcodec is not enabled
if test "x$enable_rfxcodec" != xyes; then
with_simd=no
Expand Down Expand Up @@ -243,11 +251,6 @@ then
[AC_MSG_ERROR([please install libjpeg-dev or libjpeg-devel])])
fi

if test "x$enable_xrdpdebug" = "xyes"
then
CFLAGS="-g -O0"
fi

# checking for fuse
if test "x$enable_fuse" = "xyes"
then
Expand Down
2 changes: 1 addition & 1 deletion mc/mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct mod
char* data, int width, int height, int srcx, int srcy);
int (*server_set_cursor)(struct mod* v, int x, int y, char* data, char* mask);
int (*server_palette)(struct mod* v, int* palette);
int (*server_msg)(struct mod* v, char* msg, int code);
int (*server_msg)(struct mod* v, const char* msg, int code);
int (*server_is_term)(struct mod* v);
int (*server_set_clip)(struct mod* v, int x, int y, int cx, int cy);
int (*server_reset_clip)(struct mod* v);
Expand Down
5 changes: 2 additions & 3 deletions sesman/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ access_login_allowed(const char *user)

if ((0 == g_cfg->sec.ts_users_enable) && (0==g_cfg->sec.ts_always_group_check))
{
LOG_DBG("Terminal Server Users group is disabled, allowing authentication",
1);
LOG_DBG("Terminal Server Users group is disabled, allowing authentication");
return 1;
}

Expand Down Expand Up @@ -98,7 +97,7 @@ access_login_mng_allowed(const char *user)
if (0 == g_cfg->sec.ts_admins_enable)
{
LOG_DBG("[MNG] Terminal Server Admin group is disabled, "
"allowing authentication", 1);
"allowing authentication");
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion sesman/scp_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)

while ((!data) && ((retries == 0) || (current_try > 0)))
{
LOG_DBG("data %d - retry %d - currenttry %d - expr %d",
LOG_DBG("data %ld - retry %d - currenttry %d - expr %d",
data, retries, current_try,
((!data) && ((retries == 0) || (current_try > 0))));

Expand Down
2 changes: 1 addition & 1 deletion sesman/scp_v1_mng.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ scp_v1_mng_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
case SCP_SERVER_STATE_MNG_LISTREQ:
/* list disconnected sessions */
slist = session_get_byuser(NULL, &scount, SESMAN_SESSION_STATUS_ALL);
LOG_DBG("sessions on TS: %d (slist: %x)", scount, slist);
LOG_DBG("sessions on TS: %d (slist: %p)", scount, slist);
if (0 == slist)
{
log_message(LOG_LEVEL_INFO, "No sessions on Terminal Server");
Expand Down