Skip to content

Commit

Permalink
Merge pull request #32 from ament/cpplint_c_style_casts
Browse files Browse the repository at this point in the history
allow C-style casts in c code
  • Loading branch information
dirk-thomas committed Oct 19, 2015
2 parents 19cfced + 49d787a commit 3a4c19a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ament_cpplint/ament_cpplint/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5432,6 +5432,10 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
'All parameters should be named in a function')
return True

# Don't warn in C files about C-style casts
if os.path.splitext(filename)[1] in ['.c', '.h']:
return False

# At this point, all that should be left is actual casts.
error(filename, linenum, 'readability/casting', 4,
'Using C-style cast. Use %s<%s>(...) instead' %
Expand Down

0 comments on commit 3a4c19a

Please sign in to comment.