cgo: use true instead of 0 == 0 in the generated code #31109
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Inspired by dominikh/go-tools#430.
CL 142883 made it so that the code generated by cgo contains an always–true conditional
0 == 0
instead of the predefined identifiertrue
. According to the comment, it is made to account for the case whentrue
is redefined. I don't think that it was reasonable. Firstly, it still doesn't account for all cases of “stupid shadowing”, for example I can still definein my code and break cgo. Secondly, do we really need to account for that? Wouldn't a message like “identifier
foo
must not be shadowed in cgo code” do the job?The text was updated successfully, but these errors were encountered: