Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 7.0.4 - exception for binary bitwise operators and constant operands?
#1
Hi,

My interpretation of Rule 7.0.4 is that it does not allow this type of code:

Code:
my_function(FLAG_A | FLAG_B | FLAG_C);

This is quite frequent when interfacing with third-party as well as POSIX C APIs. Casting each argument to unsigned type would go in detriment of readability.

Would it make sense to add an exception for signed constants?

Thanks!
Reply


Messages In This Thread
Rule 7.0.4 - exception for binary bitwise operators and constant operands? - by cgpzs - 05-12-2024, 01:06 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)