Browse Source

libdpkg: Change PRINTFFORMAT to take only one argument

Always assume the variable arguments go just after the format string.
Guillem Jover 17 years ago
parent
commit
17432e2739
7 changed files with 19 additions and 19 deletions
  1. 1 1
      lib/dpkg/dpkg-db.h
  2. 2 2
      lib/dpkg/dpkg-def.h
  3. 10 10
      lib/dpkg/dpkg.h
  4. 1 1
      lib/dpkg/myopt.h
  5. 2 2
      lib/dpkg/parsedump.h
  6. 2 2
      src/main.h
  7. 1 1
      utils/start-stop-daemon.c

+ 1 - 1
lib/dpkg/dpkg-db.h

@@ -380,7 +380,7 @@ struct varbuf;
 extern void varbufaddc(struct varbuf *v, int c);
 extern void varbufdupc(struct varbuf *v, int c, size_t s);
 extern void varbufsubstc(struct varbuf *v, int c_src, int c_dst);
-int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
+int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2);
 int varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
 void varbufinit(struct varbuf *v, size_t size);
 void varbufreset(struct varbuf *v);

+ 2 - 2
lib/dpkg/dpkg-def.h

@@ -24,12 +24,12 @@
 
 #if HAVE_C_ATTRIBUTE
 # define CONSTANT __attribute__((constant))
-# define PRINTFFORMAT(si, tc) __attribute__((format(printf,si,tc)))
+# define PRINTFFORMAT(n) __attribute__((format(printf, n, n + 1)))
 # define NONRETURNING __attribute__((noreturn))
 # define UNUSED __attribute__((unused))
 #else
 # define CONSTANT
-# define PRINTFFORMAT(si, tc)
+# define PRINTFFORMAT(n)
 # define NONRETURNING
 # define UNUSED
 #endif

+ 10 - 10
lib/dpkg/dpkg.h

@@ -163,16 +163,16 @@ void do_internerr(const char *file, int line, const char *fmt, ...) NONRETURNING
 #endif
 
 struct varbuf;
-void ohshit(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
+void ohshit(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1);
 void ohshitv(const char *fmt, va_list al) NONRETURNING;
-void ohshite(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
+void ohshite(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1);
 void werr(const char *what) NONRETURNING;
-void warning(const char *fmt, ...) PRINTFFORMAT(1, 2);
+void warning(const char *fmt, ...) PRINTFFORMAT(1);
 
 /*** log.c ***/
 
 extern const char *log_file;
-void log_message(const char *fmt, ...) PRINTFFORMAT(1, 2);
+void log_message(const char *fmt, ...) PRINTFFORMAT(1);
 
 /* FIXME: pipef and status_pipes should not be publicly exposed. */
 struct pipef {
@@ -321,16 +321,16 @@ struct buffer_data {
 
 off_t buffer_copy_setup_PtrInt(void *p, int typeIn, void *procIn,
 					int i, int typeOut, void *procOut,
-					off_t limit, const char *desc, ...) PRINTFFORMAT(8, 9);
+					off_t limit, const char *desc, ...) PRINTFFORMAT(8);
 off_t buffer_copy_setup_PtrPtr(void *p1, int typeIn, void *procIn,
 					void *p2, int typeOut, void *procOut,
-					off_t limit, const char *desc, ...) PRINTFFORMAT(8, 9);
+					off_t limit, const char *desc, ...) PRINTFFORMAT(8);
 off_t buffer_copy_setup_IntPtr(int i, int typeIn, void *procIn,
 					void *p, int typeOut, void *procOut,
-					off_t limit, const char *desc, ...) PRINTFFORMAT(8, 9);
+					off_t limit, const char *desc, ...) PRINTFFORMAT(8);
 off_t buffer_copy_setup_IntInt(int i1, int typeIn, void *procIn,
 					int i2, int typeOut, void *procOut,
-					off_t limit, const char *desc, ...) PRINTFFORMAT(8, 9);
+					off_t limit, const char *desc, ...) PRINTFFORMAT(8);
 off_t buffer_copy_setup(buffer_arg argIn, int typeIn, void *procIn,
 		       buffer_arg argOut, int typeOut, void *procOut,
 		       off_t limit, const char *desc);
@@ -357,10 +357,10 @@ enum compress_type {
 };
 
 void decompress_cat(enum compress_type type, int fd_in, int fd_out,
-                    char *desc, ...) NONRETURNING PRINTFFORMAT(4, 5);
+                    char *desc, ...) NONRETURNING PRINTFFORMAT(4);
 void compress_cat(enum compress_type type, int fd_in, int fd_out,
                   const char *compression, char *desc, ...)
-                  NONRETURNING PRINTFFORMAT(5, 6);
+                  NONRETURNING PRINTFFORMAT(5);
 
 DPKG_END_DECLS
 

+ 1 - 1
lib/dpkg/myopt.h

@@ -42,7 +42,7 @@ struct cmdinfo {
 
 extern const char printforhelp[];
 
-void badusage(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1, 2);
+void badusage(const char *fmt, ...) NONRETURNING PRINTFFORMAT(1);
 
 #define MAX_CONFIG_LINE 1024
 

+ 2 - 2
lib/dpkg/parsedump.h

@@ -67,9 +67,9 @@ struct fieldinfo {
 };
 
 void parse_error(struct parsedb_state *ps, const struct pkginfo *pigp,
-                 const char *fmt, ...) PRINTFFORMAT(3,4);
+                 const char *fmt, ...) PRINTFFORMAT(3);
 void parse_warn(struct parsedb_state *ps, const struct pkginfo *pigp,
-                const char *fmt, ...) PRINTFFORMAT(3,4);
+                const char *fmt, ...) PRINTFFORMAT(3);
 void parse_must_have_field(struct parsedb_state *ps,
                            const struct pkginfo *pigp,
                            const char *value, const char *what);

+ 2 - 2
src/main.h

@@ -178,7 +178,7 @@ void cu_prermremove(int argc, void **argv);
 /* from errors.c */
 
 void print_error_perpackage(const char *emsg, const char *arg);
-void forcibleerr(int forceflag, const char *format, ...) PRINTFFORMAT(2,3);
+void forcibleerr(int forceflag, const char *format, ...) PRINTFFORMAT(2);
 int reportbroken_retexitstatus(void);
 int skip_due_to_hold(struct pkginfo *pkg);
 
@@ -240,7 +240,7 @@ enum debugflags {
   dbg_triggersstupid =  040000,
 };
   
-void debug(int which, const char *fmt, ...) PRINTFFORMAT(2,3);
+void debug(int which, const char *fmt, ...) PRINTFFORMAT(2);
 void log_action(const char *action, struct pkginfo *pkg);
 
 /* from trigproc.c */

+ 1 - 1
utils/start-stop-daemon.c

@@ -220,7 +220,7 @@ static int pid_is_exec(pid_t pid, const struct stat *esb);
 
 
 static void fatal(const char *format, ...)
-	NONRETURNING PRINTFFORMAT(1, 2);
+	NONRETURNING PRINTFFORMAT(1);
 static void badusage(const char *msg)
 	NONRETURNING;