summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-11 08:23:56 +0200
committerThomas Haller <thaller@redhat.com>2018-07-11 12:02:06 +0200
commite82e2ca73095ef514041cd47ef333b8412b29b2e (patch)
treeb88c44a3f4128fd4d5f78f099550cffd5a917b74
parentb41aa4bfde0a3a72adbda0d6e5e76cf35020e8f5 (diff)
downloadNetworkManager-e82e2ca73095ef514041cd47ef333b8412b29b2e.tar.gz
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.
-rwxr-xr-xcontrib/scripts/checkpatch.pl1
1 files changed, 1 insertions, 0 deletions
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;