double_quotes
from codes
to string
,
creating packed string objects. Warnings may be suppressed using the
following multifile hooks:
- string_predicate/1 to stop checking certain predicates
- valid_string_goal/1 to tell the checker that a goal is safe.
- See also
- Prolog flag
double_quotes
.
- Rewrite the code. For example, change
[X] = "a"
intoX = 0'a
. - If a particular module relies heavily on representing strings as
lists of character code, consider adding the following directive to the
module. Note that this flag only applies to the module in which it
appears.
:- set_prolog_flag(double_quotes, codes).
- Use a back quoted string (e.g.,
`text`
). Note that this will not make your code run regardless of the --traditional command line option and code exploiting this mapping is also not portable to ISO compliant systems. - If the strings appear in facts and usage is safe, add a clause to the multifile predicate check:string_predicate/1 to silence list_strings/0 on all clauses of that predicate.
- If the strings appear as an argument to a predicate that can handle string objects, add a clause to the multifile predicate check:valid_string_goal/1 to silence list_strings/0.