Permalink
Browse files

Tell GCC about the format specifiers in our debug functions.

  • Loading branch information...
1 parent 4b15af8 commit efb4fa7b29c2a2d2491c06b08dc4888d262c1f96 @nelhage committed Apr 15, 2011
Showing with 6 additions and 5 deletions.
  1. +2 −2 attach.c
  2. +4 −3 reptyr.h
View
@@ -93,7 +93,7 @@ int *get_child_tty_fds(struct ptrace_child *child, int statfd, int *count) {
if ((child->error = parse_proc_stat(statfd, &child_status)))
return NULL;
- debug("Resolved child tty: %u", child_status.ctty);
+ debug("Resolved child tty: %x", (unsigned)child_status.ctty);
if (stat("/dev/tty", &tty_st) < 0) {
child->error = errno;
@@ -169,7 +169,7 @@ int do_setsid(struct ptrace_child *child) {
if (err < 0)
return err;
- debug("Forked a child: %d", child->forked_pid);
+ debug("Forked a child: %ld", child->forked_pid);
err = ptrace_finish_attach(&dummy, child->forked_pid);
if (err < 0)
View
@@ -23,6 +23,7 @@
#define REPTYR_VERSION "0.2dev"
int attach_child(pid_t pid, const char *pty, int force_stdio);
-void die(const char *msg, ...);
-void debug(const char *msg, ...);
-void error(const char *msg, ...);
+#define __printf __attribute__((format(printf, 1, 2)))
+void __printf die(const char *msg, ...);
+void __printf debug(const char *msg, ...);
+void __printf error(const char *msg, ...);

0 comments on commit efb4fa7

Please sign in to comment.