From e82e2ca73095ef514041cd47ef333b8412b29b2e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 11 Jul 2018 08:23:56 +0200 Subject: [PATCH] checkpatch: warn about using glib typedefs like gchar or gint We should not use glib typedefs for basic C types char, short, int, long, float or double. We commonly do not use them, so enforce consistency. That is not true for typedefs like guint, which we commonly use because it's shorter typing than "unsigned int" (or "int unsigned" or "unsigned"). Whether or not to use guint is left undecided at this point. --- contrib/scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl index b78e3b8f1c..55e08498ad 100755 --- a/contrib/scripts/checkpatch.pl +++ b/contrib/scripts/checkpatch.pl @@ -119,6 +119,7 @@ next unless $filename =~ /\.[ch]$/; complain ('Tab following a space') if $line =~ / \t/; complain ('Trailing whitespace') if $line =~ /[ \t]$/; +complain ('Don\'t use glib typedefs for char/short/int/long/float/double') if $line =~ /\bg(char|short|int|long|float|double)\b/; # Further on we process stuff without comments. $_ = $line;