srg-imperial / GrayC

GrayC: Greybox Fuzzing of Compilers and Analysers for C
https://srg.doc.ic.ac.uk/projects/grayc/
56 stars 1 forks source link

Enhancing the Robustness of the Helper Scripts with Additional String Matching or Similar Changes #5

Open junweizeng opened 1 year ago

junweizeng commented 1 year ago

Hi @arindam-8 .

Here's a simple example, test.c:

int main
{
    a = 1;
}
  1. Initially, I compiled it (gcc test.c) on an Ubuntu system without full-width single quotation marks (). The output was as follows:

    test.c: In function 'main': test.c:3:5: error: 'a' undeclared (first use in this function) 3 | a = 1; | ^ test.c:3:5: note: each undeclared identifier is reported only once for each function it appears in

    The In function 'main': in this case uses a half-width single quotation mark.

  2. However, when I switched to an Ubuntu system with Chinese language support (which includes full-width single quotation marks ), and recompiled it (gcc test.c), the output changed to:

    test.c: In function ‘main’: test.c:3:5: error: ‘a’ undeclared (first use in this function) a = 1; ^ test.c:3:5: note: each undeclared identifier is reported only once for each function it appears in

    The In function ‘main’:in this case uses a full-width single quotation mark.

I apologize for the previous commit, which was incorrect. I think the original -ve "In function ‘bug’:" should be retained, and we can add -ve "In function 'bug':" after it to enhance the robustness of the program.

Originally posted by @Vanish-Zeng in https://github.com/srg-imperial/GrayC/issues/4#issuecomment-1597316781

There may be other string matching or similar changes that can enhance the robustness of the helper scripts. Feel free to contribute additional suggestions.