commit aa3d537a81995664bfa9a5d514bcee3b8550c8f0
Author: Nico Schottelius <nico@brief.schottelius.org>
Date:   Sat Oct 27 00:04:24 2012 +0200

    typo: 1.20.5 should have been 1.20.6
    
    Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>

diff --git a/doc/changelog b/doc/changelog
index de64bcf..c8f5d3e 100644
--- a/doc/changelog
+++ b/doc/changelog
@@ -5,7 +5,7 @@
 	* Don't build static libgpm by default (Sean McGovern)
 	* autogen.sh is now required to create setup version in autoconf (Nico Schottelius)
 
-1.20.5: 9th of February 2009
+1.20.6: 9th of February 2009
 	* Some cleanups (Mike Frysinger/Nico Schottelius)
 	* Pull in fcntl.h rather than unistd.h for open() (Mike Frysinger)
 	* Fix gcc warning "control reaches end of non-void function" (Mike Frysinger)

commit ac8c32938ff06ad657db472bd499fced3b9293dc
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Oct 28 07:16:07 2012 -0400

    switch to xz
    
    The lzma format is dead and everyone has moved to xz.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/Makefile.in b/Makefile.in
index 5412334..542110c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -102,7 +102,7 @@ TAGS:	$(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS
 
 ### RELEASE STUFF
 TARS  =../gpm-$(release).tar.gz
-TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma
+TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.xz
 
 M_HOST=arcana.linux.it
 M_DIR=gpm/
@@ -122,8 +122,8 @@ distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
 ../gpm-$(release).tar.bz2:  ../gpm-$(release).tar
 	bzip2 -9 -c $< > $@
 
-../gpm-$(release).tar.lzma:  ../gpm-$(release).tar
-	lzma -9 -c $< > $@
+../gpm-$(release).tar.xz:  ../gpm-$(release).tar
+	xz -9 -c $< > $@
 
 # 3. Put package together into .tar.gz and .tar.bz2
 dist: disttest distclean distconf $(TARS)

commit 01373f6fd5dd274116c8ec693245677dbf5390e6
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Oct 28 07:25:40 2012 -0400

    install shared lib with +x perms
    
    This is executable code, so it should have +x perms on the file.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/src/Makefile.in b/src/Makefile.in
index d3b1dcd..6b60ad3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -113,7 +113,7 @@ install:	check
 	# 2.x goes along; unfortunately that means an additional
 	# headache in cases like this
 	if test "x@SHLIB@" != "x" ; then \
-		$(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@	;	\
+		$(INSTALL_DATA) -m 755 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@	;	\
 		cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ 					;	\
       echo "WARNING: We installed a lib, you should now call ldconfig" 						; 	\
       echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" 								;	\

commit 84e562b1d96a65476546cddf60cb277ad3add474
Author: Nico Schottelius <nico@brief.schottelius.org>
Date:   Sun Oct 28 14:52:07 2012 +0100

    ++change(1.20.8)
    
    Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>

diff --git a/doc/changelog b/doc/changelog
index c8f5d3e..1581fd1 100644
--- a/doc/changelog
+++ b/doc/changelog
@@ -1,3 +1,7 @@
+1.20.8:
+	* Remove lzma, use xz (Mike Frysinger)
+	* Install shared lib with +x perms (Mike Frysinger)
+
 1.20.7: 2012-10-26
 	* Fix inclusion of unwanted binary data
 	* Even more cleanups (Mike Frysinger)

commit c6e63161543082be80a2897f92b732324a8324b1
Author: Nico Schottelius <nico@brief.schottelius.org>
Date:   Fri Nov 2 13:06:53 2012 +0100

    ensure permissions are setup correctly
    
    Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>

diff --git a/Makefile.in b/Makefile.in
index 542110c..07a67d4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -108,6 +108,7 @@ M_HOST=arcana.linux.it
 M_DIR=gpm/
 
 tars: $(TARS)
+	chmod a+r $<
 
 # configure headers, produce new configure script
 distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
@@ -126,7 +127,7 @@ distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
 	xz -9 -c $< > $@
 
 # 3. Put package together into .tar.gz and .tar.bz2
-dist: disttest distclean distconf $(TARS)
+dist: disttest distclean distconf $(TARS) tars
 	scp $(TARS) $(M_HOST):$(M_DIR)
 	mv $(TARS) ~/niconetz/software/gpm/archives
 

commit 73158372a7b036c3e16bd874c526bb85b67278be
Author: nick black <nick.black@sprezzatech.com>
Date:   Fri Feb 8 05:48:58 2013 -0500

    kill printf(3) format warning for time_t

diff --git a/src/prog/display-coords.c b/src/prog/display-coords.c
index ed15c8a..1fb810f 100644
--- a/src/prog/display-coords.c
+++ b/src/prog/display-coords.c
@@ -33,6 +33,7 @@
  */
 
 #include <unistd.h>           /* write, read, open    */
+#include <stdint.h>
 #include <stdlib.h>           /* strtol()             */
 #include <stdio.h>            /* printf()             */
 #include <time.h>             /* time()               */
@@ -50,7 +51,7 @@ int display_data(Gpm_Event *event, void *data)
    last  = now;
 
    /* display time, delta time */
-   printf("[%d] delta: %ds",now,delta);
+   printf("[%jd] delta: %ds",(intmax_t)now,delta);
    
    /* display mouse information */
    printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy);

commit 5648239f18ac041fe1a93b8b784bf3ca8e1d83bc
Author: nick black <nick.black@sprezzatech.com>
Date:   Fri Feb 8 05:52:13 2013 -0500

    fix highly illegal return of int as char *, and less worrying set-but-not-used warning

diff --git a/src/twiddler.c b/src/twiddler.c
index 1d2bd50..972a616 100644
--- a/src/twiddler.c
+++ b/src/twiddler.c
@@ -250,7 +250,6 @@ static inline int twiddler_use_item(char *item)
 int twiddler_key(unsigned long message)
 {
    char **table = twiddler_get_table(message);
-   char *val;
   /*
    * These two are needed to avoid transmitting single keys when typing
    * chords. When the number of keys being held down decreases, data
@@ -269,7 +268,6 @@ int twiddler_key(unsigned long message)
 
    if (!table) return 0;
    message &= 0xff;
-   val = table[message];
 
    if ((message < last_message) && !marked) { /* ok, do it */
       marked++; /* don't retransmit on release */
@@ -428,8 +426,11 @@ char *twiddler_rest_to_value(char *s)
       buf[ibuf]='\0';
       return strdup(buf);
    }
-   if (*ptr == '\\')
-      return (char *)twiddler_escape_sequence(ptr+1, &len /* unused */);
+   if (*ptr == '\\') {
+      buf[ibuf++] = twiddler_escape_sequence(ptr+1, &len /* unused */);
+      buf[ibuf] = '\0';
+      return strdup(buf);
+   }
 
    if (strlen(ptr)==1) return ((char *)((unsigned long)*ptr & 0xFF));
 

commit 8385b860a4288e9ebc25d42f62803f538dd9da10
Author: nick black <nick.black@sprezzatech.com>
Date:   Fri Feb 8 05:59:04 2013 -0500

    of course we can. fixes value-computed-is-unused warning

diff --git a/src/daemon/old_main.c b/src/daemon/old_main.c
index 9cd4e56..2581e26 100644
--- a/src/daemon/old_main.c
+++ b/src/daemon/old_main.c
@@ -192,10 +192,11 @@ int old_main()
                 * or to the default handler, if any
                 * or to the selection handler
                 */ /* FIXME -- check event.vc */
-               /* can't we please rewrite the following a bit nicer?*/
-               (cinfo[event.vc] && do_client(cinfo[event.vc], &event))
-               || (cinfo[0]        && do_client(cinfo[0],        &event))
-               ||  do_selection(&event);
+               if(!cinfo[event.vc] || !do_client(cinfo[event.vc], &event)) {
+                    if(!cinfo[0] || !do_client(cinfo[0],&event)) {
+                        do_selection(&event);
+                    }
+	       }
             }
       }
 

commit bd582fc77acc3ee71da083bf430e12324c44245e
Author: nick black <nick.black@sprezzatech.com>
Date:   Fri Feb 8 06:06:34 2013 -0500

    if you're using strlen() on it, as we are in tp_serial_send_cmd(), it had better be a plain char. make it so, killing one warning. no reason to sprintf() into an unsigned char buffer, so make it not, killing the other. this cleans all warnings from synaptic.c using gcc 3.7.2

diff --git a/src/synaptics.c b/src/synaptics.c
index 2418c75..a978ef0 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -214,6 +214,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <limits.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
 
@@ -2241,8 +2242,7 @@ static void syn_process_config (info_type ident,
 
 
 
-static unsigned char tp_hextoint (unsigned char byte1,
-				  unsigned char byte2) 
+static unsigned char tp_hextoint (unsigned byte1,unsigned byte2) 
 {
   unsigned char bytes [3];
   int result;
@@ -2250,7 +2250,7 @@ static unsigned char tp_hextoint (unsigned char byte1,
   bytes [0] = byte1;
   bytes [1] = byte2;
   bytes [2] = '\0';
-  sscanf (bytes, "%x", &result);
+  sscanf ((char *)bytes, "%x", &result);
   return result;
 }
 
@@ -2311,8 +2311,7 @@ static void tp_serial_read (int fd,
 }
 
 /* Write a string of commands */
-static void tp_serial_send_cmd(int fd,
-			       unsigned char *cmd) 
+static void tp_serial_send_cmd(int fd, const char *cmd) 
 {
   unsigned char junk [15];
 
@@ -2329,7 +2328,7 @@ static void tp_serial_send_cmd(int fd,
 static void syn_serial_set_mode (int fd,
 				 unsigned char mode) 
 {
-  unsigned char bytes [15];
+  char bytes [15];
 
   sprintf (bytes, "%%C3B%02X5555", mode);
 #if DEBUG_SENT_DATA

commit a4aea32acf410aa01623b0bc214e0f5189a87098
Author: nick black <nick.black@sprezzatech.com>
Date:   Fri Feb 8 06:24:28 2013 -0500

    fix your damn email address, nico

diff --git a/doc/doc.gpm.in b/doc/doc.gpm.in
index afd5a29..795b958 100644
--- a/doc/doc.gpm.in
+++ b/doc/doc.gpm.in
@@ -88,7 +88,7 @@ by the Free Software Foundation.
 @subtitle A general purpose mouse server for the Linux console
 @subtitle @value{update-month}
 
-@author by Nico Schottelius <nico@@schottelius.org>
+@author by Nico Schottelius <nico-gpm2008@@schottelius.org>
 
 @end titlepage
 @setchapternewpage off
@@ -525,7 +525,7 @@ security risks when using them.
 Andrew Haylett <ajh@gec-mrc.co.uk> (the original selection code)
 Ian Zimmerman <itz@speakeasy.org> (old maintainer)
 Alessandro Rubini <rubini@linux.it> (old maintainer (still helps a lot))
-Nico Schottelius <nico@schottelius.org> (maintainer)
+Nico Schottelius <nico-gpm2008@schottelius.org> (maintainer)
 
 Many many contributors, to both selection and gpm.
 .fi

commit 06b00d53d8bd513ad5d262dc94a016c6fbf2d3aa
Author: Kamil Rytarowski <n54@gmx.com>
Date:   Sat May 4 01:30:17 2013 +0200

    Install unversioned solibrary
    
    Unversioned solibraries are shipped with -devel packages in Linux
    distros. Generate and install it for the consistency.

diff --git a/src/Makefile.in b/src/Makefile.in
index 6b60ad3..7e9e2ef 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -79,7 +79,7 @@ prog/%:	prog/%.o
 #		| $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
 
 # Do it all!
-all:	gpm lib/libgpm.so.@abi_lev@ @LIBGPM_A@ $(PROG)
+all:	gpm lib/libgpm.so.@abi_lev@ lib/libgpm.so @LIBGPM_A@ $(PROG)
 
 gpm:	$(GOBJ)
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
@@ -168,9 +168,8 @@ lib/libgpm.so.@abi_full@:	$(PICS)
 	@LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS)	
 lib/libgpm.so.@abi_lev@:	lib/libgpm.so.@abi_full@
 	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@
-# unneeded, isn't it?
-#lib/libgpm.so:	lib/libgpm.so.@abi_full@
-#	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
+lib/libgpm.so:	lib/libgpm.so.@abi_full@
+	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
 
 include $(DEPFILE)
 

commit e9da8e172359071a9c79eb68fce810e92487e775
Author: Kamil Rytarowski <n54@gmx.com>
Date:   Sat May 4 01:22:26 2013 +0200

    Resolve linking against ncursesw
    
    The NCURSES library ships with wide-character (UTF-8) version of
    libncurses, the wide-character file is called ncursesw.so*. Check if
    it is present and link against it.

diff --git a/configure.ac.footer b/configure.ac.footer
index 89a4cd9..1e5e4da 100644
--- a/configure.ac.footer
+++ b/configure.ac.footer
@@ -124,7 +124,7 @@ No|no|N|n) SHARED_LIBS=-lc ;;
     done
     TERMLIBS=$LIBS
     LIBS=
-    for i in ncurses curses; do
+    for i in ncurses curses ncursesw; do
         if test x$LIBS = x; then
             AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
         else :; fi

commit d88fb1de5803c366ab62f7de9ee5d83207fb2afe
Author: Dima Krasner <dima@dimakrasner.com>
Date:   Wed Nov 12 23:06:46 2014 +0200

    Added musl support to libgpm and the daemon.

diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
index 98297c9..4d6c0af 100644
--- a/src/daemon/open_console.c
+++ b/src/daemon/open_console.c
@@ -21,6 +21,7 @@
 
 #include <fcntl.h>                  /* open and co.      */
 #include <sys/stat.h>               /* stat()            */
+#include <sys/types.h>              /* major()           */
 #include <sys/ioctl.h>              /* ioctl             */
 
 /* Linux specific (to be outsourced in gpm2 */
diff --git a/src/prog/display-buttons.c b/src/prog/display-buttons.c
index de8e5b2..38d2f11 100644
--- a/src/prog/display-buttons.c
+++ b/src/prog/display-buttons.c
@@ -36,6 +36,7 @@
 #include <stdio.h>            /* printf()             */
 #include <time.h>             /* time()               */
 #include <errno.h>            /* errno                */
+#include <sys/select.h>       /* fd_set and FD_*      */
 #include <gpm.h>              /* gpm information      */
 
 /* display resulting data */
diff --git a/src/prog/display-coords.c b/src/prog/display-coords.c
index 1fb810f..82afd12 100644
--- a/src/prog/display-coords.c
+++ b/src/prog/display-coords.c
@@ -38,6 +38,7 @@
 #include <stdio.h>            /* printf()             */
 #include <time.h>             /* time()               */
 #include <errno.h>            /* errno                */
+#include <sys/select.h>       /* fd_set and FD_*      */
 #include <gpm.h>              /* gpm information      */
 
 /* display resulting data */
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 069d801..188ae35 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -1199,9 +1199,9 @@ int main(int argc, char **argv)
 #if defined(__GLIBC__)
    __sigemptyset(&childaction.sa_mask);
 #else /* __GLIBC__ */
-   childaction.sa_mask=0;
+   sigemptyset(&childaction.sa_mask);
 #endif /* __GLIBC__ */
-   childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
+   childaction.sa_flags=0;
    sigaction(SIGCHLD,&childaction,NULL);
 
    /*....................................... Connect and get your buffer */

commit e55e60cc492b51ced88b5637eded7130d5afef9f
Merge: e9da8e1 d88fb1d
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Mon Nov 17 18:31:01 2014 +0100

    Merge pull request #5 from dimkr/master
    
    musl support

commit 7d21d7f469d90c2d55b23926c866bba635aa7e6f
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Feb 14 18:05:49 2016 -0500

    report/oops: constify format strings

diff --git a/src/headers/gpm.h b/src/headers/gpm.h
index 57dc618..9e96deb 100644
--- a/src/headers/gpm.h
+++ b/src/headers/gpm.h
@@ -280,10 +280,10 @@ int   Gpm_GetSnapshot(Gpm_Event *ePtr);
 char *Gpm_get_console( void );
 int Gpm_x_high_y(int base, int pot_y);
 int Gpm_cnt_digits(int number);
-void gpm_oops(int line, char *file, char *text, ... );
+void gpm_oops(int line, const char *file, const char *text, ... );
 
 /* report.c / report-lib.c */
-void gpm_report(int line, char *file, int stat, char *text, ... );
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
 
 #ifdef __cplusplus
   };
diff --git a/src/headers/message.h b/src/headers/message.h
index a0fed0e..25cad8c 100644
--- a/src/headers/message.h
+++ b/src/headers/message.h
@@ -226,7 +226,7 @@
 /* #define GPM_MESS_                   "" */
 
 /* functions */
-void gpm_report(int line, char *file, int stat, char *text, ... );
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
 
 /* rest of wd.h */
 #ifdef HAVE_SYSLOG_H
diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c
index c0ae086..b565b77 100644
--- a/src/lib/report-lib.c
+++ b/src/lib/report-lib.c
@@ -24,9 +24,9 @@
 
 #include "headers/message.h"
 
-void gpm_report(int line, char *file, int stat, char *text, ... )
+void gpm_report(int line, const char *file, int stat, const char *text, ... )
 {
-   char *string = NULL;
+   const char *string = NULL;
    int log_level;
    va_list ap;
 
diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
index 0bb1982..ab8d602 100644
--- a/src/prog/mouse-test.c
+++ b/src/prog/mouse-test.c
@@ -182,7 +182,7 @@ Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type,
 /*----------------------------------------------------------------------------- 
    Place the description here.
  -----------------------------------------------------------------------------*/
-int mousereopen(int oldfd, char *name, Gpm_Type *type)
+int mousereopen(int oldfd, const char *name, Gpm_Type *type)
 {
    int fd;
    if (!type) type=mice+1; /* ms */
diff --git a/src/report.c b/src/report.c
index 6c7c2ee..286c1b7 100644
--- a/src/report.c
+++ b/src/report.c
@@ -69,7 +69,7 @@
  *
  */
 
-void gpm_report(int line, char *file, int stat, char *text, ... )
+void gpm_report(int line, const char *file, int stat, const char *text, ...)
 {
    FILE *console = NULL;
    va_list ap, ap3;

commit 7ba518ff8b5e5c06d0a74b1fecf3b682f14c631c
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Feb 14 18:07:46 2016 -0500

    report: avoid -Wformat-security warnings
    
    Some functions warn when you pass a string to a printf style function
    that is a dynamic buffer as its contents cannot be verified.  Since we
    don't want to support that here, just use %s.

diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c
index b565b77..03230b4 100644
--- a/src/lib/report-lib.c
+++ b/src/lib/report-lib.c
@@ -47,7 +47,7 @@ void gpm_report(int line, const char *file, int stat, const char *text, ... )
                            log_level = LOG_CRIT; break;
    }
 #ifdef HAVE_VSYSLOG
-   syslog(log_level, string);
+   syslog(log_level, "%s", string);
    vsyslog(log_level, text, ap);
 #else
    fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
index ab8d602..d7d1027 100644
--- a/src/prog/mouse-test.c
+++ b/src/prog/mouse-test.c
@@ -189,7 +189,7 @@ int mousereopen(int oldfd, const char *name, Gpm_Type *type)
    close(oldfd);
    usleep(100000);
    fd=open(name,O_RDWR);
-   if (fd < 0) gpm_report(GPM_PR_OOPS,name);
+   if (fd < 0) gpm_report(GPM_PR_OOPS, "%s", name);
    (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */
    return fd;
 }

commit c3717d54b67133fd14ce4f2166f61e529a1dcfe4
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Feb 14 18:08:54 2016 -0500

    update ignored file list

diff --git a/.gitignore b/.gitignore
index 87df93b..5f79b9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ Makefile
 Makefile.include
 /aclocal.m4
 /autom4te.cache
+/config.cache
 /config.log
 /config.status
 /configure
@@ -29,7 +30,7 @@ Makefile.include
 /src/gpm
 /src/gpm2/tmp
 /src/gpm2/out
-/src/lib/libgpm.so.*
+/src/lib/libgpm.so*
 /src/prog/disable-paste
 /src/prog/display-buttons
 /src/prog/display-coords

commit 01265c7ac5f86a02a7cec323f34a3b54e5973872
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Feb 14 21:02:48 2016 -0500

    report/oops: add attributes to mark as printf functions
    
    This allows gcc to do printf checking on calls to these funcs to make
    sure they're being called correctly.

diff --git a/src/headers/gpm.h b/src/headers/gpm.h
index 9e96deb..fe52e53 100644
--- a/src/headers/gpm.h
+++ b/src/headers/gpm.h
@@ -280,9 +280,15 @@ int   Gpm_GetSnapshot(Gpm_Event *ePtr);
 char *Gpm_get_console( void );
 int Gpm_x_high_y(int base, int pot_y);
 int Gpm_cnt_digits(int number);
+#ifdef __GNUC__
+__attribute__((__format__(printf, 3, 4)))
+#endif
 void gpm_oops(int line, const char *file, const char *text, ... );
 
 /* report.c / report-lib.c */
+#ifdef __GNUC__
+__attribute__((__format__(printf, 4, 5)))
+#endif
 void gpm_report(int line, const char *file, int stat, const char *text, ... );
 
 #ifdef __cplusplus
diff --git a/src/headers/message.h b/src/headers/message.h
index 25cad8c..4b60291 100644
--- a/src/headers/message.h
+++ b/src/headers/message.h
@@ -226,6 +226,9 @@
 /* #define GPM_MESS_                   "" */
 
 /* functions */
+#ifdef __GNUC__
+__attribute__((__format__(printf, 4, 5)))
+#endif
 void gpm_report(int line, const char *file, int stat, const char *text, ... );
 
 /* rest of wd.h */

commit 85b451a188cfc8aa6233df55ec0c5dfcd203786f
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Feb 14 21:08:28 2016 -0500

    clean up a few unused funcs/vars

diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 188ae35..5126c65 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -443,6 +443,7 @@ void f__fix(struct passwd *pass)
 }
 
 /*---------------------------------------------------------------------*/
+#if 0
 static int f_debug_one(FILE *f, Draw *draw)
 {
    DrawItem *ip;
@@ -465,6 +466,7 @@ static int f_debug_one(FILE *f, Draw *draw)
 #undef LINE
    return 0;
 }
+#endif
 
 int f_debug(int mode, DrawItem *self, int uid)
 {
@@ -960,10 +962,8 @@ static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
 /*------------*/
 static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
 {
-   int x,y, dumpfd;
+   int dumpfd;
    char dumpname[20];
-
-   x=buffer[2]; y=buffer[3];
    
    /* WILL NOT WORK WITH DEVFS! FIXME! */
    sprintf(dumpname,"/dev/vcsa%i",vc);

commit dbd2e04665da885805a2c3e7dc2ee4b733d3c7cd
Merge: e55e60c 85b451a
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Wed Mar 9 12:44:42 2016 +0100

    Merge pull request #10 from vapier/master
    
    misc warning cleanups

commit b350aee4ea5785a75cb6ad770f6b768c506ebb70
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Mar 14 15:39:54 2016 -0400

    fix building w/newer glibc
    
    Linux C libraries are looking to disentangle sysmacros.h from the
    sys/types.h include, so make sure we pull in the header when it is
    found.

diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
index 4d6c0af..6dd43e6 100644
--- a/src/daemon/open_console.c
+++ b/src/daemon/open_console.c
@@ -24,6 +24,10 @@
 #include <sys/types.h>              /* major()           */
 #include <sys/ioctl.h>              /* ioctl             */
 
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>          /* major() w/newer glibc */
+#endif
+
 /* Linux specific (to be outsourced in gpm2 */
 #include <linux/serial.h>           /* for serial console check */
 #include <asm/ioctls.h>            /* for serial console check */

commit ae45075f75acb1a7c066fb0c857655ec8dd33a29
Merge: dbd2e04 b350aee
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Thu Mar 31 18:16:06 2016 +0200

    Merge pull request #12 from vapier/master
    
    fix building w/newer glibc

commit f346d2682b211f6808626b3f507dc9409365f546
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Jun 5 20:43:19 2016 -0400

    dist: include generated autotools in tarballs
    
    We don't want to make people building gpm have to install autotools
    and run bootstrap steps.

diff --git a/Makefile.in b/Makefile.in
index 07a67d4..0aa6a78 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -115,7 +115,11 @@ distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
 
 ../gpm-$(release).tar: $(srcdir) distclean distconf
 	# no exclude possible of .git with pax it seems, so the following is not possible:
-	git archive --prefix "gpm-$(release)/" -o $@ HEAD
+	rm -rf "gpm-$(release)/"
+	git archive --prefix "gpm-$(release)/" HEAD | tar xf -
+	cd "gpm-$(release)/" && ./autogen.sh && rm -rf autom4te.cache
+	tar cf $@ "gpm-$(release)/"
+	rm -rf "gpm-$(release)/"
 
 ../gpm-$(release).tar.gz:  ../gpm-$(release).tar
 	gzip -9 -c $< > $@

commit e6b6d7507abe03e5ae60f4b86bff69dc1940b16a
Merge: ae45075 f346d26
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Mon Jun 6 08:07:00 2016 +0200

    Merge pull request #15 from vapier/master
    
    dist: include generated autotools in tarballs

commit 80cac2a2bd7eed7e80626559f792f37319030729
Author: Desmond O. Chang <dochang@gmail.com>
Date:   Wed Apr 13 21:17:48 2016 +0800

    Add gcc include path
    
    Close #13

diff --git a/src/Makefile.in b/src/Makefile.in
index 7e9e2ef..2f92989 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c
 
 	# create dependencies
 	for DEPS in `echo *.c */*.c`; do \
-	$(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
+	$(CC) -I. -I $(srcdir) -I $(srcdir)/headers -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
 	$(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
 
 ### INSTALL

commit 4337fd9fc2d2ea83654f2ca69245503730231ac3
Author: iljavs <ivansprundel@ioactive.com>
Date:   Mon Jun 27 01:17:57 2016 -0700

    fix signedness issue
    
    This commit fixes a signedness issue, where a negative vc coming from a malicious client could possibly cause memory corruption.

diff --git a/src/daemon/processconn.c b/src/daemon/processconn.c
index a5839a3..e92fa63 100644
--- a/src/daemon/processconn.c
+++ b/src/daemon/processconn.c
@@ -67,7 +67,8 @@ int processConn(int fd)
       return -1;
    }
 
-   if((vc = request->vc) > MAX_VC) {
+   vc = request->vc;
+   if(vc > MAX_VC || vc < 0) {
       gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
       free(info);
       close(newfd);

commit f4e5af26d8d0a428453c619dd1efe4a451cd3cb8
Merge: e6b6d75 4337fd9
Author: iljavs <ivansprundel@ioactive.com>
Date:   Wed Jul 13 20:02:56 2016 -0700

    Merge pull request #1 from iljavs/signedness-patch-1
    
    fix signedness issue

commit 1fd19417b8a4dd9945347e98dfa97e4cfd798d77
Merge: e6b6d75 f4e5af2
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Tue Jul 26 23:21:36 2016 +0200

    Merge pull request #17 from iljavs/master
    
    fix signedness issue

commit fdc42770596e25749f7e2ce0ea97882177397167
Author: Khem Raj <raj.khem@gmail.com>
Date:   Sun Jun 25 07:25:33 2017 -0700

    Use sigemptyset API instead of __sigemptyset
    
    __sigemptyset has been removed from glibc public
    API headers in upcoming (2.26) release onwards
    
    Signed-off-by: Khem Raj <raj.khem@gmail.com>

diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 5126c65..76c896c 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -1196,11 +1196,7 @@ int main(int argc, char **argv)
                                                         LOG_DAEMON : LOG_USER);
    /* reap your zombies */
    childaction.sa_handler=reap_children;
-#if defined(__GLIBC__)
-   __sigemptyset(&childaction.sa_mask);
-#else /* __GLIBC__ */
    sigemptyset(&childaction.sa_mask);
-#endif /* __GLIBC__ */
    childaction.sa_flags=0;
    sigaction(SIGCHLD,&childaction,NULL);
 

commit 21f4f4aede1cae705fa0c9112ef34afbe38413d2
Author: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
Date:   Sat Dec 29 23:44:24 2018 -0600

    Update gpm.c

diff --git a/src/daemon/gpm.c b/src/daemon/gpm.c
index 771da5c..6806dce 100644
--- a/src/daemon/gpm.c
+++ b/src/daemon/gpm.c
@@ -29,7 +29,7 @@
 #include <signal.h>        /* SIGPIPE */
 #include <time.h>          /* time() */
 #include <sys/param.h>
-#include <sys/fcntl.h>     /* O_RDONLY */
+#include <fcntl.h>         /* O_RDONLY */
 #include <sys/wait.h>      /* wait()   */
 #include <sys/stat.h>      /* mkdir()  */
 #include <sys/time.h>      /* timeval */

commit 2085cab74a0a84df8b965addf007775a7225c9ec
Author: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
Date:   Sat Dec 29 23:47:17 2018 -0600

    Add include <string.h>
    
    Added
     line 28, #include <string.h>                 /* strcpy, bzero     */
    for musl compilation

diff --git a/src/daemon/old_main.c b/src/daemon/old_main.c
index 2581e26..ab7a87f 100644
--- a/src/daemon/old_main.c
+++ b/src/daemon/old_main.c
@@ -25,6 +25,7 @@
 #include <signal.h>                 /* guess again       */
 #include <errno.h>                  /* guess again       */
 #include <unistd.h>                 /* unlink            */
+#include <string.h>                 /* strcpy, bzero     */
 #include <sys/stat.h>               /* chmod             */
 
 #include <linux/kd.h>               /* linux hd*         */

commit afe69339e311a498eba4c978a865839f33b66e7a
Author: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
Date:   Sat Dec 29 23:52:58 2018 -0600

    Update liblow.c for musl compatible
    
    Changed #include <sys/fcntl.h>   to    #include <fcntl.h>
    Changed SA_NOMASK to SA_NODEFER on lines 176, 367

diff --git a/src/lib/liblow.c b/src/lib/liblow.c
index e789d09..8d6ba34 100644
--- a/src/lib/liblow.c
+++ b/src/lib/liblow.c
@@ -33,7 +33,7 @@
 #include <sys/types.h>     /* socket() */
 #include <sys/socket.h>    /* socket() */
 #include <sys/un.h>        /* struct sockaddr_un */
-#include <sys/fcntl.h>     /* O_RDONLY */
+#include <fcntl.h>     /* O_RDONLY */
 #include <sys/stat.h>      /* stat() */
 
 #ifdef  SIGTSTP         /* true if BSD system */
@@ -173,7 +173,7 @@ static void gpm_suspend_hook (int signum)
   /* Reincarnation. Prepare for another death early. */
   sigemptyset(&sa.sa_mask);
   sa.sa_handler = gpm_suspend_hook;
-  sa.sa_flags = SA_NOMASK;
+  sa.sa_flags = SA_NODEFER;
   sigaction (SIGTSTP, &sa, 0);
 
   /* Pop the gpm stack by closing the useless connection */
@@ -364,7 +364,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
 
          /* if signal was originally ignored, job control is not supported */
          if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
-            sa.sa_flags = SA_NOMASK;
+            sa.sa_flags = SA_NODEFER;
             sa.sa_handler = gpm_suspend_hook;
             sigaction(SIGTSTP, &sa, 0);
          }

commit 668445350055e4bbeec9c15bd4db14a7f07abc45
Author: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
Date:   Mon Dec 31 18:41:19 2018 -0600

    Aligned comments

diff --git a/src/lib/liblow.c b/src/lib/liblow.c
index 8d6ba34..8b40b71 100644
--- a/src/lib/liblow.c
+++ b/src/lib/liblow.c
@@ -29,11 +29,12 @@
 #include <string.h>        /* strncmp */
 #include <unistd.h>        /* select(); */
 #include <errno.h>
+#include <fcntl.h>         /* O_RDONLY */
+
 #include <sys/time.h>      /* timeval */
 #include <sys/types.h>     /* socket() */
 #include <sys/socket.h>    /* socket() */
 #include <sys/un.h>        /* struct sockaddr_un */
-#include <fcntl.h>     /* O_RDONLY */
 #include <sys/stat.h>      /* stat() */
 
 #ifdef  SIGTSTP         /* true if BSD system */

commit 631aa6f5ed41ed1b2b51e6eba34d5afcf3d8ba94
Merge: 1fd1941 fdc4277
Author: Nico Schottelius <nico-github.com@schottelius.org>
Date:   Thu Aug 1 13:19:10 2019 +0200

    Merge pull request #20 from kraj/master
    
    Use sigemptyset API instead of __sigemptyset

commit 4a938233fbe6de7af05aabc74891b68d4bae40f8
Merge: 631aa6f 6684453
Author: Darko Poljak <darko.poljak@gmail.com>
Date:   Tue Oct 8 18:40:45 2019 +0200

    Merge pull request #30 from kurtnalty/gpm_musl
    
    Gpm musl

commit f04f24dd5ca5c1c13608b144ab66e2ccd47f106a
Author: Sergei Trofimovich <slyfox@gentoo.org>
Date:   Sun Jan 19 19:53:41 2020 +0000

    src/headers/daemon.h: avoid redefinition of 'last_selection_time'
    
    Noticed build failure on gcc-10 as:
    
    ```
    gcc  -L/home/slyfox/dev/git/gpm/src  -o gpm mice.o ... report.o tools.o   -lm
    ld: twiddler.o:gpm/src/headers/daemon.h:183:
      multiple definition of `last_selection_time'; mice.o:gpm/src/headers/daemon.h:183: first defined here
    ld: synaptics.o:git/gpm/src/headers/daemon.h:183:
      multiple definition of `last_selection_time'; mice.o:git/gpm/src/headers/daemon.h:183: first defined here
    ```
    
    gcc-10 will change the default from -fcommon to fno-common:
    https://gcc.gnu.org/PR85678.
    
    The error also happens if CFLAGS=-fno-common passed explicitly.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

diff --git a/src/headers/daemon.h b/src/headers/daemon.h
index a8936ad..24a1a97 100644
--- a/src/headers/daemon.h
+++ b/src/headers/daemon.h
@@ -180,7 +180,7 @@ extern struct mouse_features  mouse_table[3],
 extern Gpm_Type         mice[];
 extern Gpm_Type         *repeated_type;
 
-time_t                  last_selection_time;
+extern time_t           last_selection_time;
 
 
 

commit 0e1586db1649627417b382cf7b011d0a8b45f5fb
Merge: 4a93823 80cac2a
Author: Darko Poljak <darko.poljak@gmail.com>
Date:   Wed Jun 17 12:52:48 2020 +0200

    Merge pull request #14 from dochang/add-include-path
    
    Add gcc include path

commit e82d1a653ca94aa4ed12441424da6ce780b1e530
Merge: 0e1586d f04f24d
Author: Darko Poljak <darko.poljak@gmail.com>
Date:   Wed Jun 17 12:57:36 2020 +0200

    Merge pull request #37 from trofi/master
    
    src/headers/daemon.h: avoid redefinition of 'last_selection_time'
