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

BETTY WARNING: "unnecessary whitespace before a quoted newline" #18

Open
Hillmonkey opened this issue Jul 9, 2017 · 9 comments
Open

Comments

@Hillmonkey
Copy link

Not a huge issue, but the following line triggers a warning from betty:
#define DELIM " \n\t"
... see the warning as quoted in the subject ...
I do a workaround by placing the space character between the newline and tab chars like so:
#define DELIM "\n \t"

@yeungegs
Copy link

Have you tried escaping the whitespace?
`

Or, quoting the space itself?

@Hillmonkey
Copy link
Author

White space?!? I've been trying to escape white space my whole life! Ha!

I'm thinking that escaping whitespace is more relevant in the context of bash scripting ... less so in a C program, unless I am building a string to pass into the shell.

I guess what I'm saying is that I think this Betty warning is legitimate in other contexts, but less so in the context of defining a macro.

@ken00alx
Copy link

white space has been painting my brain white and chunky leading to different warnings

@Chimekinglsey
Copy link

Please can anyone suggect on how i can remove this trailing whitespace error?

@ken00alx
Copy link

ken00alx commented Oct 20, 2022 via email

@ayoubelmohamedi
Copy link

usually check line by line whether there is an extra whitespace in the beginning or end. You must know how many whitespace you have to handle since the compiler does tell in case you have a debugger for it.
errors are often looks similar to this:
ERROR: trailing whitespace
total: 1 errors, 0 warnings, 23 lines checked

@nyambuukim
Copy link

root@ca08fbc1980a:~/alx-low_level_programming/0x01-variables_if_else_while# betty 2-print_alphabet.c

========== 2-print_alphabet.c ==========
2-print_alphabet.c:15: ERROR: trailing whitespace
total: 1 errors, 0 warnings, 15 lines checked
main

@ayoubelmohamedi
Copy link

@nyambuukim Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline.

@khlifaelbad
Copy link

2-print_alphabet.c:15: ERROR: trailing whitespace
total: 1 errors, 0 warnings, 15 lines checked => this issue inside main has checked with betty so u hve to followed betty docs instructions so here trailing whitespace means u have to remove space between lines or u do 2 spaces like while (..).

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

7 participants