Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify behavior of blt_list_append ? #654

Open
kennyweiss opened this issue Aug 30, 2023 · 0 comments
Open

Modify behavior of blt_list_append ? #654

kennyweiss opened this issue Aug 30, 2023 · 0 comments
Labels
design question User Request Related to user requests

Comments

@kennyweiss
Copy link
Member

The Axom project recently fixed a bug related to ENV variables that were not correctly setup -- LLNL/axom#1168

It revealed that blt_list_append generates a FATAL_ERROR when attempting to append empty strings to a list.

if ( NOT DEFINED arg_ELEMENTS )
message(FATAL_ERROR "blt_list_append() requires ELEMENTS to be specified and non-empty" )
endif()

Is this the desired behavior? Or would it be better if appending an empty string to a list was a no-op?

Ben Liu suggested some additional options:

  • blt_list_append should emit a warning in this case since this is often unexpected behavior
  • blt_list_append should take an (optional) additional parameter regarding how to treat this case, e.g. FATAL_ERROR, warning or no-op. If we pursue this option, we'd also need to decide on the default behavior.

@white238 noted that CMake's (list(APPEND <empty string>) is a no-op

@kennyweiss kennyweiss added question design User Request Related to user requests labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design question User Request Related to user requests
Projects
None yet
Development

No branches or pull requests

1 participant