Skip to content

Commit

Permalink
fix discarded-qualifier compiler warnings (#67)
Browse files Browse the repository at this point in the history
* fix discarded-qualifier compiler warnings

* fixed duplicate symbol error

* updated RCS logs for indimail-mta

* added RCS logs for daemontools

* added RCS log for ucspi-tcp

* create_rpm: use x.y for release

* updated ChangeLogs
  • Loading branch information
mbhangui authored May 9, 2024
1 parent b7b7aff commit de5f132
Show file tree
Hide file tree
Showing 419 changed files with 3,290 additions and 2,376 deletions.
2 changes: 1 addition & 1 deletion daemontools-x/conf-cc-LINUX
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Wimplicit -fno-strict-aliasing -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-align -Wwrite-strings -Wno-discarded-qualifiers
-Wimplicit -fno-strict-aliasing -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-align -Wwrite-strings
47 changes: 24 additions & 23 deletions daemontools-x/create_rpm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh
# $Log: create_rpm,v $
# Revision 1.6 2024-05-09 23:04:25+05:30 Cprogrammer
# use x.y for release
#
# Revision 1.5 2022-10-04 23:47:04+05:30 Cprogrammer
# use rpmlintrc from .config directory
#
Expand All @@ -16,7 +19,7 @@
# Initial revision
#
#
# $Id: create_rpm,v 1.5 2022-10-04 23:47:04+05:30 Cprogrammer Exp mbhangui $
# $Id: create_rpm,v 1.6 2024-05-09 23:04:25+05:30 Cprogrammer Exp mbhangui $
#
version=$(head -1 conf-version)

Expand Down Expand Up @@ -166,28 +169,26 @@ fi
dist=`uname -r |cut -d . -f4`
if [ -z "$release" ] ; then
if [ -f /usr/sbin/svscan ] ; then
idist=$(rpm -qf /usr/sbin/svscan|cut -d- -f3|cut -d. -f3)
if [ " $dist" = " $idist" ] ; then
iversion=$(rpm -qf /usr/sbin/svscan|cut -d- -f2)
if [ "$iversion" = "$version" ] ; then
release=$(rpm -qf /usr/sbin/svscan | cut -d- -f3 | cut -d. -f2)
release=$(expr $release + 1)
else
release=1
fi
#idist=$(rpm -qf /usr/sbin/svscan|cut -d- -f3|rev|cut -d. -f2|rev)
dversion=$(rpm -qf /usr/sbin/svscan|cut -d- -f2)
if [ "$dversion" = "$version" ] ; then
t1=$(rpm -qf /usr/sbin/svscan | cut -d- -f3 | cut -d. -f1)
t2=$(rpm -qf /usr/sbin/svscan | cut -d- -f3 | cut -d. -f2)
t2=$(expr $t2 + 1)
release="$t1.$t2"
else
release=1
release=0.1
fi
else
release=1
release=0.1
fi
fi
echo -n "Build RPM for daemontools-"$version"-1."$release" (Y/N) - "
echo -n "Build RPM for daemontools-"$version"-"$release" (Y/N) - "
read key
if [ " $key" = " Y" -o " $key" = " y" ] ; then
tmprel=`cat daemontools-x/conf-release 2>/dev/null`
if [ ! " $tmprel" = " 1.$release" ] ; then
echo 1.$release > daemontools-x/conf-release
if [ ! " $tmprel" = " $release" ] ; then
echo $release > daemontools-x/conf-release
cd daemontools-x
make SYSTEM=$SYSTEM daemontools.spec
cp daemontools.spec /tmp
Expand All @@ -207,21 +208,21 @@ if [ " $key" = " Y" -o " $key" = " y" ] ; then
fi
if [ $? -eq 0 ] ; then
/bin/rm -f /tmp/daemontools.spec
rpm --addsign $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"1.$release".$dist.$build_arch.rpm
rpm --addsign $rpmbuild/SRPMS/daemontools-"$version"-"1.$release".$dist.src.rpm
echo -n "RPM lint for daemontools-"$version"-1."$release" (Y/N) - "
rpm --addsign $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"$release".$dist.$build_arch.rpm
rpm --addsign $rpmbuild/SRPMS/daemontools-"$version"-"$release".$dist.src.rpm
echo -n "RPM lint for daemontools-"$version"-"$release" (Y/N) - "
read key
if [ " $key" = " Y" -o " $key" = " y" ] ; then
(
echo daemontools-"$version"-"1.$release".$dist.rpm
echo daemontools-"$version"-"$release".$dist.rpm
if [ -f $HOME/.config/daemontools.rpmlintrc ] ; then
rpmlint -r $HOME/.config/daemontools.rpmlintrc $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"1.$release".$dist.$build_arch.rpm
rpmlint -r $HOME/.config/daemontools.rpmlintrc $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"$release".$dist.$build_arch.rpm
else
rpmlint $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"1.$release".$dist.$build_arch.rpm
rpmlint $rpmbuild/RPMS/$build_arch/daemontools-"$version"-"$release".$dist.$build_arch.rpm
fi
echo ------------------------
echo daemontools-"$version"-"1.$release".$dist.src.rpm
rpmlint $rpmbuild/SRPMS/daemontools-"$version"-"1.$release".$dist.src.rpm
echo daemontools-"$version"-"$release".$dist.src.rpm
rpmlint $rpmbuild/SRPMS/daemontools-"$version"-"$release".$dist.src.rpm
echo ------------------------
) 2>&1 | less
fi
Expand Down
5 changes: 4 additions & 1 deletion daemontools-x/deepsleep.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: deepsleep.c,v $
* Revision 1.3 2024-05-09 22:40:04+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2004-10-22 20:24:17+05:30 Cprogrammer
* added RCS id
*
Expand Down Expand Up @@ -33,7 +36,7 @@ deepsleep(unsigned int s)
void
getversion_deepsleep_c()
{
static char *x = "$Id: deepsleep.c,v 1.2 2004-10-22 20:24:17+05:30 Cprogrammer Stab mbhangui $";
const char *x = "$Id: deepsleep.c,v 1.3 2024-05-09 22:40:04+05:30 mbhangui Exp mbhangui $";

x++;
}
2 changes: 2 additions & 0 deletions daemontools-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Release @version@-@release@ Start 05/02/2024 End XX/XX/XXXX
- 12/04/2024
07. daemontools.spec.in, debian/preinst.in: fixed logdir permissions
08. minisvc.in: fix for missing qmail group
- 09/05/2024
09. fix discarded-qualifier compiler warnings

* Sun Mar 03 2024 12:20:15 +0000 Manvendra Bhangui <daemontools@indimail.org> 1.1.4-1.1%{?dist}
Release 1.1.4-1.1 Start 09/02/2024 End 03/02/2024
Expand Down
9 changes: 6 additions & 3 deletions daemontools-x/envdir.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: envdir.c,v $
* Revision 1.8 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.7 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
Expand Down Expand Up @@ -38,7 +41,7 @@
static char **orig_env;

no_return void
die_usage(char *str)
die_usage(const char *str)
{
if (str)
strerr_die3x(100, FATAL, str, "\nusage: envdir [-cwi] dir child");
Expand All @@ -49,7 +52,7 @@ die_usage(char *str)
int
main(int argc, char **argv)
{
char *fn, *err = (char *) 0;
const char *fn, *err = (char *) 0;
char **e;
int i, opt, warn_on_error = 0, ignore_unreadable = 0,
unreadable_count = 0;
Expand Down Expand Up @@ -100,7 +103,7 @@ main(int argc, char **argv)
void
getversion_envdir_main_c()
{
static char *x = "$Id: envdir.c,v 1.7 2021-08-30 12:04:53+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: envdir.c,v 1.8 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}
5 changes: 4 additions & 1 deletion daemontools-x/envuidgid.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: envuidgid.c,v $
* Revision 1.5 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.4 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
Expand Down Expand Up @@ -64,7 +67,7 @@ main(int argc, char **argv)
void
getversion_envuidgid_c()
{
static char *x = "$Id: envuidgid.c,v 1.4 2021-08-30 12:04:53+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: envuidgid.c,v 1.5 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}
7 changes: 5 additions & 2 deletions daemontools-x/fghack.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: fghack.c,v 1.6 2022-12-18 12:54:03+05:30 Cprogrammer Exp mbhangui $
* $Id: fghack.c,v 1.7 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $
*/
#include <unistd.h>
#include <signal.h>
Expand Down Expand Up @@ -93,13 +93,16 @@ main(int argc, char **argv, char **envp)
void
getversion_fghack_c()
{
static char *x = "$Id: fghack.c,v 1.6 2022-12-18 12:54:03+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: fghack.c,v 1.7 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}

/*
* $Log: fghack.c,v $
* Revision 1.7 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.6 2022-12-18 12:54:03+05:30 Cprogrammer
* handle wait status with details
*
Expand Down
11 changes: 7 additions & 4 deletions daemontools-x/inotify.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: inotify.c,v $
* Revision 1.12 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.11 2022-01-30 09:53:48+05:30 Cprogrammer
* added missing '/' in display
*
Expand Down Expand Up @@ -56,7 +59,7 @@
#define FATAL "inotify: fatal: "
#define SELECTTIMEOUT 5

char *usage = "usage: inotify [-n] path1..path2";
const char *usage = "usage: inotify [-n] path1..path2";
int ifd, _soptind, _sargc;

typedef struct inotify_dir {
Expand All @@ -66,7 +69,7 @@ typedef struct inotify_dir {
INOTIFY_DIR *wd;

void
out(char *str)
out(const char *str)
{
if (!str || !*str)
return;
Expand Down Expand Up @@ -103,7 +106,7 @@ main(int argc, char **argv)
struct timeval *tptr;
time_t last_timeout;
char buffer[EVENT_BUF_LEN], strnum[FMT_ULONG];
char *ptr;
const char *ptr;
fd_set rfds; /*- File descriptor mask for select -*/

if (argc < 2)
Expand Down Expand Up @@ -285,7 +288,7 @@ main(int argc, char **argv)
void
getversion_inotify_c()
{
static char *x = "$Id: inotify.c,v 1.11 2022-01-30 09:53:48+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: inotify.c,v 1.12 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}
9 changes: 6 additions & 3 deletions daemontools-x/installer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: installer.c,v 1.26 2024-03-11 17:54:44+05:30 Cprogrammer Exp mbhangui $
* $Id: installer.c,v 1.27 2024-05-09 22:03:17+05:30 mbhangui Exp mbhangui $
* taken from ezmlm-0.54
*/
#include <sys/types.h>
Expand Down Expand Up @@ -64,7 +64,7 @@ get_octal(mode_t mode)
}

void
print_info(const char *str, char *source, char *dest, mode_t mode, uid_t uid, gid_t gid, unsigned long size)
print_info(const char *str, const char *source, const char *dest, mode_t mode, uid_t uid, gid_t gid, unsigned long size)
{
struct passwd *pw;
struct group *gr;
Expand Down Expand Up @@ -669,14 +669,17 @@ main(int argc, char **argv)
void
getversion_installer_c()
{
static const char *x = "$Id: installer.c,v 1.26 2024-03-11 17:54:44+05:30 Cprogrammer Exp mbhangui $";
static const char *x = "$Id: installer.c,v 1.27 2024-05-09 22:03:17+05:30 mbhangui Exp mbhangui $";

if (x)
x++;
}

/*
* $Log: installer.c,v $
* Revision 1.27 2024-05-09 22:03:17+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.26 2024-03-11 17:54:44+05:30 Cprogrammer
* fixed displaying size variable
* fixed allocation of zerobuf variable
Expand Down
5 changes: 4 additions & 1 deletion daemontools-x/logselect.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: logselect.c,v $
* Revision 1.3 2024-05-09 22:40:04+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
Expand Down Expand Up @@ -237,7 +240,7 @@ main(int argc, char **argv)
void
getversion_logselect_c()
{
static char *x = "$Id: logselect.c,v 1.2 2021-08-30 12:04:53+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: logselect.c,v 1.3 2024-05-09 22:40:04+05:30 mbhangui Exp mbhangui $";

x++;
}
5 changes: 4 additions & 1 deletion daemontools-x/match.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: match.c,v $
* Revision 1.3 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2004-10-22 20:27:16+05:30 Cprogrammer
* added RCS id
*
Expand Down Expand Up @@ -47,7 +50,7 @@ match(char *pattern, char *buf, unsigned int len)
void
getversion_match_c()
{
static char *x = "$Id: match.c,v 1.2 2004-10-22 20:27:16+05:30 Cprogrammer Stab mbhangui $";
const char *x = "$Id: match.c,v 1.3 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}
17 changes: 10 additions & 7 deletions daemontools-x/multilog.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: multilog.c,v 1.9 2024-02-18 08:42:01+05:30 Cprogrammer Exp mbhangui $
* $Id: multilog.c,v 1.10 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $
*/
#include <unistd.h>
#include <time.h>
Expand Down Expand Up @@ -37,14 +37,14 @@ mode_t old_umask;
static int f_sync;

void
pause3(char *s1, char *s2, char *s3)
pause3(const char *s1, const char *s2, const char *s3)
{
strerr_warn4(WARNING, s1, s2, s3, &strerr_sys);
deepsleep(5);
}

void
pause5(char *s1, char *s2, char *s3, char *s4, char *s5)
pause5(const char *s1, const char *s2, const char *s3, const char *s4, const char *s5)
{
strerr_warn6(WARNING, s1, s2, s3, s4, s5, &strerr_sys);
deepsleep(5);
Expand Down Expand Up @@ -149,7 +149,7 @@ filesfit(struct cyclog *d)
}

void
finish(struct cyclog *d, char *file, char *code)
finish(struct cyclog *d, const char *file, const char *code)
{
struct stat st;
#ifdef HASUNLINKAT
Expand Down Expand Up @@ -227,8 +227,8 @@ startprocessor(struct cyclog *d)
return;
if (fd_move(5, fd) == -1)
return;
args[0] = "sh";
args[1] = "-c";
args[0] = (char *) "sh";
args[1] = (char *) "-c";
args[2] = d->processor;
args[3] = 0;
execve("/bin/sh", args, environ);
Expand Down Expand Up @@ -689,13 +689,16 @@ main(int argc, char **argv)
void
getversion_multilog_c()
{
static char *x = "$Id: multilog.c,v 1.9 2024-02-18 08:42:01+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: multilog.c,v 1.10 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}

/*
* $Log: multilog.c,v $
* Revision 1.10 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.9 2024-02-18 08:42:01+05:30 Cprogrammer
* use unlinkat() if available instead of unlink()
*
Expand Down
5 changes: 4 additions & 1 deletion daemontools-x/multipipe.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: multipipe.c,v $
* Revision 1.5 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.4 2020-10-08 12:07:42+05:30 Cprogrammer
* formatted code
*
Expand Down Expand Up @@ -401,7 +404,7 @@ main(int argc, char **argv)
void
getversion_multipipe_c()
{
static char *x = "$Id: multipipe.c,v 1.4 2020-10-08 12:07:42+05:30 Cprogrammer Exp mbhangui $";
const char *x = "$Id: multipipe.c,v 1.5 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";

x++;
}
Loading

0 comments on commit de5f132

Please sign in to comment.