Remove VLAs for Compiler Compatibility?

Asked by Brock

Currently, it isn't possible to compile this library with compilers that do not support VLAs. I'm wondering if it would be desirable to replace them with calls to alloca() or malloc() to allow for compatibility with more compilers. If so, I would be happy to submit a pull request containing those changes.

Question information

Language:
English Edit question
Status:
Answered
For:
libvterm Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) said :
#2

alloca() isn't really much better than the VLAs, to be honest. Also, VLAs were part of C99, a standard which is now almost 20 years old, so really any decent compiler ought to support them by now.

A better plan is a reshaping of the way the parsing works so that dynamic-sized pieces aren't required. That was originally the plan for malloc-less operation during runtime (apart from resize operations), but the current implementation of bits of Unicode combining mean they're still there. It should be possible to take them out though.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) said :
#3

answered

Can you help with this problem?

Provide an answer of your own, or ask Brock for more information if necessary.

To post a message you must log in.