Gencpp adds a newline after last line of message definition even if there is none in the proto
If the msg proto ends without a newline, genpy (IMO correctly) generates the message definition also without this ending newline. On the other hand, gencpp always adds a newline to the last line of definition. This results in different message definitions between gencpp- and genpy- generated files.
See yourself e.g. in geometry_msgs. Vector3 has no ending newline in the proto, and this is what genpy and gencpp generate:
gencpp: "float64 z\n"
genpy: float64 z"""
I think the difference is caused by this line of code:
https://github.com/ros/gencpp/blob/e85a18515b249b409beb3f98300fae7177c95d62/src/gencpp/init.py#L111
The question is - can this be fixed in the already released ROS 1 versions? Or would that be an API-break? Regarding the definitions stored in e.g. rosbags, they already differ depending on whether the publisher was a rospy or roscpp one. So I guess removing or adding the ending newline doesn't actually break anything.