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

error: non-ISO-standard escape sequence, '\e' #62

Closed
dd4e opened this issue May 25, 2020 · 5 comments
Closed

error: non-ISO-standard escape sequence, '\e' #62

dd4e opened this issue May 25, 2020 · 5 comments

Comments

@dd4e
Copy link

dd4e commented May 25, 2020

Hello!

When building release 1.9 with -Werror, an error occurs: "error: non-ISO-standard escape sequence, '\ e' [-Werror]"

link to line

@p-ranav
Copy link
Owner

p-ranav commented May 25, 2020

Paging @wolfv @felixguendling

Hey guys. Is there an ISO-standards compliant way to show and hide console cursor in *nix?

Relevant code:

static inline void show_console_cursor(bool const show) {
  std::fputs(show ? "\e[?25h" : "\e[?25l", stdout);
}

@felixguendling
Copy link
Contributor

Seems like "\e" is GNU only and "\033" is the standard sequence.
Which compiler does produce this warning? Which settings are used? Compiling current master with GCC 9 worked fine for me. Currently, I cannot reproduce the warning/error.

@dd4e
Copy link
Author

dd4e commented May 26, 2020

Seems like "\e" is GNU only and "\033" is the standard sequence.
Which compiler does produce this warning? Which settings are used? Compiling current master with GCC 9 worked fine for me. Currently, I cannot reproduce the warning/error.

This error is repeated only in release 1.9, there is no error in the master branch.

gcc version:

gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

compile keys:

-Wall -Wextra -pedantic -Werror

diff maser->release 1.9

1573c1573
<   std::fputs(show ? "\033[?25h" : "\033[?25l", stdout);
---
>   std::fputs(show ? "\e[?25h" : "\e[?25l", stdout);

@p-ranav
Copy link
Owner

p-ranav commented May 26, 2020

Okay, thanks. I've moved the tag for v1.9 to the latest commit in master. master was just one commit ahead. v1.9 should work for you now.

@dd4e
Copy link
Author

dd4e commented May 26, 2020

Thanks! Good job))

@dd4e dd4e closed this as completed May 26, 2020
MacDada added a commit to MacDada/DnWiFiDoorLock that referenced this issue Jun 18, 2023
```
lib/DnAppArduino/src/DnApp/Arduino/WelcomeMessagePrinter.h:137:41: warning: non-ISO-standard escape sequence, '\e'
  137 |         const auto VT100_FORMAT_GREEN = "\e[0;32m";
      |                                         ^~~~~~~~~~
```

p-ranav/indicators#62 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants