8000 windows compilation issue when building huge msg · Issue #49 · ros/gencpp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

windows compilation issue when building huge msg #49

Closed
muratory opened this issue Sep 2, 2020 · 2 comments
Closed

windows compilation issue when building huge msg #49

muratory opened this issue Sep 2, 2020 · 2 comments

Comments

@muratory
Copy link
muratory commented Sep 2, 2020

when using custom message with big structure, we may reach the windows compilator limit of 65535 character for a string.

This happens in msg creation when building the comment string in escape_message_definition function.

proposed patch is to break when 64000 size limit is reached 👍
def escape_message_definition(definition):
lines = definition.splitlines()
if not lines:
lines.append('')
s = StringIO()
count = 0
for line in lines:
line = _escape_string(line)
# individual string literals cannot be too long; need to utilize string concatenation for long strings
# https://docs.microsoft.com/en-us/cpp/c-language/maximum-string-length?view=vs-2017
s.write('"%s\n"\n' % (line))
#patch to exit when line total greater than 64000 due to windows compil limitation
count = count + len(line) + 6
if count > 64000:
break
val = s.getvalue()
s.close()
return val

@dirk-thomas
Copy link
Member

Please consider to create a pull request with your proposed patch.

@sloretz
Copy link
Contributor
sloretz commented May 31, 2025

ROS 1 is end-of-life (EOL) as of today, May 31st 2025. I am archiving this repository because:

  • it only supports ROS 1
  • it isn't needed anymore in ROS 2

If you still rely on ROS 1, read this page to learn about your options.

@sloretz sloretz closed this as completed May 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0