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:
@@ -119,6 +119,7 @@ next unless $filename =~ /\.[ch]$/;
|
|||||||
|
|
||||||
complain ('Tab following a space') if $line =~ / \t/;
|
complain ('Tab following a space') if $line =~ / \t/;
|
||||||
complain ('Trailing whitespace') 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.
|
# Further on we process stuff without comments.
|
||||||
$_ = $line;
|
$_ = $line;
|
||||||
|
Reference in New Issue
Block a user