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

Fix 28 gcc output parse error #54

Merged
merged 4 commits into from
Nov 26, 2014

Conversation

neelabhg
Copy link
Member

Fix #28:

  1. Modified gcc output parser to output an error for the case mentioned in the issue.
  2. Updated/fixed the linker test in the parser spec:
    The test expected one error. However, it should have expected two errors, but the parser returned only one because the gcc output string used a file name other than program.c. If the test were updated to use program.c, the test would have broken. Now, after updating the parser regex to take into account file names other than program.c, the test broke. So, I fixed the test to expect two errors and modified the test input to use program.c anyway.
  3. Just as a fallback, if the compilation fails but the parser fails to return any errors, the error label shows a generic message instead of the error/warning count. Previously, the error label was empty, so the user couldn't click on it to reveal the gcc output window.
  4. index.html cleanup

… no error/warning count information is available on a failed compilation (due to parsing problems), then an error label is still shown.
…e use a modal) and move gcc error modal html markup inside the show-if-supported div
…dated regex - the test should have expected 2 errors actually, but because of the old regex the expected output was incorrect and the test conformed to the incorrect output. So fixing the regex required fixing the test too. Also, updated the test to use program.c in the error text.
@neelabhg
Copy link
Member Author

@scowalt Can you review this? Especially the change in the parser regex and the parser unit tests.
I'm merging this in because it "works", but I want you to provide feedback anyway.

@neelabhg neelabhg added this to the UIUC senior project fall 2014 milestone Nov 26, 2014
neelabhg added a commit that referenced this pull request Nov 26, 2014
@neelabhg neelabhg merged commit 9688029 into cs-education:master Nov 26, 2014
@neelabhg neelabhg deleted the fix_28_gcc_output_parse_error branch November 26, 2014 08:17
@scowalt
Copy link
Contributor

scowalt commented Nov 29, 2014

These changes look fine to me. I'm unsure of why 'error' is the expected error type in line 61 of the testing file, but everything else looks good.

@neelabhg
Copy link
Member Author

Because the error text is "undefined reference", which should be an error.
Currently for that input the parser cannot figure out the error type, and outputs (.text+0x20) as the error type (which is actually the location of the error, just not in col:row format).

@angrave
Copy link
Contributor

angrave commented Nov 30, 2014

Sanity check:

Is the UI also more reasonable/obvious for link errors (e.g. errors that
do not have a specific line number)?
e.g.

int f();
int main() { f(); return 0;}

or worse, let's choose a function that's part of C stdio but give it a
different signature :-)

int puts();
int main() { puts(); return 0;}

Another example... (if -pthread gcc option is not defined...)

#include <pthread.h>
int main() { pthread_join(( |pthread_t )|0,NULL); return 0;}

Another example = empty source file!

Another example: Causing errors in an include file

#define int abc
#include <stdio.h>

Best,
Lawrence.

On 11/29/14 2:37 PM, Scott Walters wrote:

These changes look fine to me. I'm unsure of why 'error' is the
expected error type in line 61 of the testing file, but everything
else looks good.


Reply to this email directly or view it on GitHub
#54 (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

Successfully merging this pull request may close these issues.

gcc output parse error (filenames may start with and include /)
3 participants