song_update, udp_server: workarounds for gcc 4.1 warnings

Annoying false positives.
This commit is contained in:
Max Kellermann 2012-03-01 20:11:04 +01:00
parent c551c8b31b
commit e7ce362d22
2 changed files with 8 additions and 0 deletions

View File

@ -113,6 +113,11 @@ song_file_update(struct song *song)
GMutex *mutex = NULL;
GCond *cond;
#if !GCC_CHECK_VERSION(4, 2)
/* work around "may be used uninitialized in this function"
false positive */
cond = NULL;
#endif
do {
/* load file tag */

View File

@ -97,6 +97,9 @@ udp_server_new(unsigned port,
.s_addr = htonl(INADDR_ANY),
},
.sin_port = htons(port),
#if defined(__linux__) && !GCC_CHECK_VERSION(4, 2)
.sin_zero = { 0 },
#endif
};
if (bind(fd, (const struct sockaddr *)&address, sizeof(address)) < 0) {