08-12-2021, 09:08 AM
Hi,
the rule mentioned in the title states:
Rule A13-2-3 (required, implementation, automated) A relational operator shall return a boolean value.
The AUTOSAR document then proceeds to give some examples where the compliant ones have the function declaration stating the return type as `bool`.
So, to be compliant with the rule, is it necessary to just check the return type of the function? Or should we try to evaluate the type of the object returned in the return statement inside the function in order to see if it is an actual `bool` and that no implicit casts were used?
By just looking at the examples, based also on where the `// Compliant` and `// Non-compliant` comments are, it seems to me that checking the function type signature in its prototype is enough.
What do you think?
Thanks.
the rule mentioned in the title states:
Rule A13-2-3 (required, implementation, automated) A relational operator shall return a boolean value.
The AUTOSAR document then proceeds to give some examples where the compliant ones have the function declaration stating the return type as `bool`.
So, to be compliant with the rule, is it necessary to just check the return type of the function? Or should we try to evaluate the type of the object returned in the return statement inside the function in order to see if it is an actual `bool` and that no implicit casts were used?
By just looking at the examples, based also on where the `// Compliant` and `// Non-compliant` comments are, it seems to me that checking the function type signature in its prototype is enough.
What do you think?
Thanks.