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.
This commit is contained in:
Thomas Haller
2018-07-11 08:23:56 +02:00
parent b41aa4bfde
commit e82e2ca730

View File

@@ -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;