From fee59c2271f1d403238ca7da908a537c53a5e264 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 7 Jun 2020 16:30:34 -0400 Subject: Replace __printflike with __attribute__((format(printf, ...))) sed -E 's/__printf0?like[(]([^,]+), ([^)]+)[)]/__attribute__((format(printf, \1, \2)))/' --- bin/1sh/error.c | 2 +- bin/1sh/error.h | 6 +++--- bin/1sh/mknodes.c | 2 +- bin/1sh/output.h | 10 +++++----- bin/1sh/show.h | 2 +- bin/1sh/test.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/1sh/error.c b/bin/1sh/error.c index 62d406f5..57c10fae 100644 --- a/bin/1sh/error.c +++ b/bin/1sh/error.c @@ -67,7 +67,7 @@ volatile sig_atomic_t suppressint; volatile sig_atomic_t intpending; -static void exverror(int, const char *, va_list) __printf0like(2, 0) __attribute__((noreturn)); +static void exverror(int, const char *, va_list) __attribute__((format(printf, 2, 0))) __attribute__((noreturn)); /* * Called to raise an exception. Since C doesn't include exceptions, we diff --git a/bin/1sh/error.h b/bin/1sh/error.h index 964d98e8..0401598f 100644 --- a/bin/1sh/error.h +++ b/bin/1sh/error.h @@ -81,9 +81,9 @@ extern volatile sig_atomic_t intpending; void exraise(int) __attribute__((noreturn)); void onint(void) __attribute__((noreturn)); -void warning(const char *, ...) __printflike(1, 2); -void error(const char *, ...) __printf0like(1, 2) __attribute__((noreturn)); -void exerror(int, const char *, ...) __printf0like(2, 3) __attribute__((noreturn)); +void warning(const char *, ...) __attribute__((format(printf, 1, 2))); +void error(const char *, ...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); +void exerror(int, const char *, ...) __attribute__((format(printf, 2, 3))) __attribute__((noreturn)); /* diff --git a/bin/1sh/mknodes.c b/bin/1sh/mknodes.c index e5eacb14..9ec4dfbd 100644 --- a/bin/1sh/mknodes.c +++ b/bin/1sh/mknodes.c @@ -104,7 +104,7 @@ static void indent(int, FILE *); static int nextfield(char *); static void skipbl(void); static int readline(FILE *); -static void error(const char *, ...) __printf0like(1, 2) __attribute__((noreturn)); +static void error(const char *, ...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); static char *savestr(const char *); diff --git a/bin/1sh/output.h b/bin/1sh/output.h index 867b7169..8d5ded6f 100644 --- a/bin/1sh/output.h +++ b/bin/1sh/output.h @@ -71,11 +71,11 @@ void flushout(struct output *); void freestdout(void); int outiserror(struct output *); void outclearerror(struct output *); -void outfmt(struct output *, const char *, ...) __printflike(2, 3); -void out1fmt(const char *, ...) __printflike(1, 2); -void out2fmt_flush(const char *, ...) __printflike(1, 2); -void fmtstr(char *, int, const char *, ...) __printflike(3, 4); -void doformat(struct output *, const char *, va_list) __printflike(2, 0); +void outfmt(struct output *, const char *, ...) __attribute__((format(printf, 2, 3))); +void out1fmt(const char *, ...) __attribute__((format(printf, 1, 2))); +void out2fmt_flush(const char *, ...) __attribute__((format(printf, 1, 2))); +void fmtstr(char *, int, const char *, ...) __attribute__((format(printf, 3, 4))); +void doformat(struct output *, const char *, va_list) __attribute__((format(printf, 2, 0))); FILE *out1fp(void); int xwrite(int, const char *, int); diff --git a/bin/1sh/show.h b/bin/1sh/show.h index 332685c9..68840549 100644 --- a/bin/1sh/show.h +++ b/bin/1sh/show.h @@ -34,7 +34,7 @@ void showtree(union node *); #ifdef DEBUG -void sh_trace(const char *, ...) __printflike(1, 2); +void sh_trace(const char *, ...) __attribute__((format(printf, 1, 2))); void trargs(char **); void trputc(int); void trputs(const char *); diff --git a/bin/1sh/test.c b/bin/1sh/test.c index 71c62e11..54c16eef 100644 --- a/bin/1sh/test.c +++ b/bin/1sh/test.c @@ -38,7 +38,7 @@ #else #include -static void error(const char *, ...) __attribute__((noreturn)) __printf0like(1, 2); +static void error(const char *, ...) __attribute__((noreturn)) __attribute__((format(printf, 1, 2))); static void error(const char *msg, ...) -- cgit 1.4.1 span>Include stdio.h in gfb.cJune McEnroe 2018-02-07Exit by returning false from input to gf{b,cocoa}June McEnroe 2018-02-07Rename title to status in gfcocoaJune McEnroe 2018-02-06Require 4 bit counts on gfxx command lineJune McEnroe 2018-02-06Add gfxx controls for custom bitsJune McEnroe 2018-02-06Add gfxx palette loading and dumpingJune McEnroe 2018-02-06Add tags targetJune McEnroe 2018-02-06Replace gfxx SCALE macro with interp functionJune McEnroe 2018-02-05Rename gfxx space indexed and add palette samplingJune McEnroe 2018-02-05Take scale into account for when to stop drawing in gfxxJune McEnroe 2018-02-05Always skip most significant bits in gfxxJune McEnroe 2018-02-05Set title in gfcocoaJune McEnroe 2018-02-05Double-buffer gfb frontendJune McEnroe 2018-02-05Rewrite gfxx bit handlingJune McEnroe 2018-02-05Add flip option to gfxxJune McEnroe 2018-02-05Remove gfxx reverse optionJune McEnroe 2018-02-04Fix gfxx draw stop conditionJune McEnroe 2018-02-04Reuse CGColorSpace and CGDataProvider in gfcocoaJune McEnroe 2018-02-04Mark mac target phonyJune McEnroe 2018-02-04Set up Makefile for gfxx-cocoa or gfxx-fbJune McEnroe 2018-02-04Avoid doing excessive work in gfxxJune McEnroe 2018-02-04Handle window resizing in gfcocoaJune McEnroe 2018-02-04Set cinoptionsJune McEnroe 2018-02-04Tweak colorscheme moreJune McEnroe 2018-02-04Color MatchParen DarkYellowJune McEnroe 2018-02-04Add palette sampling to gfxxJune McEnroe 2018-02-04Add 4-bit RGB to gfxxJune McEnroe 2018-02-04Add Quit menu item to gfcocoaJune McEnroe 2018-02-04Switch back to sane Objective-C styleJune McEnroe 2018-02-04Quit gfcocoa when window closesJune McEnroe 2018-02-03Apparently this is how people write Objective-CJune McEnroe