rose-compiler/rose

The error exist in stdio.h

if362005 opened this issue · 5 comments

When I run the command "make check-core -j10", the error is reported as in the title. The problem is shown in the screenshot
image

How do I solve this problem?I would be grateful for any help I can get

Can you provide information about your environment? and configuration?

Thanks

Can you provide information about your environment? and configuration?

Thanks

Thank you for your reply!

The server operating system is Ubuntu 18.04. The Boost‘s version is 1.65.1. I used GCC 8.4.0.

If additional environment and configuration parameters are needed, please let me know.
Thanks

I'm also getting the same problem on Ubuntu 18.04 64bits:

rose-config --version-long
ROSE 0.11.106.0 (configured Tuesday November 15 11:16:00 2022)
  --- logic assertions:           enabled
  --- full optimization:          disabled
  --- boost library:              1.71.0 (/home/xxx/xxx/boost_1.71)
  --- readline library:           unused
  --- library build path:         /tmp/build-dad
  --- original installation path: /home/xxx/xxx/rose-dad
  --- C/C++ analysis:             enabled
  ---   C/C++ front-end:          edg-5.0
  ---   C back-end:               9.4 (gcc)
  ---   C++ back-end:             9.4 (g++)
  --- Fortran analysis:           disabled
  --- binary analysis:            disabled
  --- Ada analysis:               disabled
  --- C# analysis:                disabled
  --- CUDA analysis:              disabled
  --- Java analysis:              disabled
  --- Jovial analysis:            disabled
  --- Matlab analysis:            disabled
  --- OpenCL analysis:            disabled
  --- PHP analysis:               disabled
  --- Python analysis:            disabled

hello.cpp:

#include <stdio.h>

int main(int argc, char *argv[]) {
    printf("Hello !\n");
    return 0;
}

Output:

rajaChecker -c hello.cpp 
"/home/mingo/local/rose-dad/include/edg/g++_HEADERS/hdrs6/bits/libio.h", line
          435: error: expected a "{"
  extern int _IO_feof (_IO_FILE *__fp) __THROW;
                                       ^

"/usr/include/stdio.h", line 144: error: expected a "{"
  extern int remove (const char *__filename) __THROW;
                                             ^

"/home/mingo/dev/c/A_grammars/rose/dad/hello.cpp", line 4: error: identifier
          "printf" is undefined
      printf("Hello !\n");
      ^

At end of source: error: expected a "}"

At end of source: error: expected a "}"

Errors in Processing Input File: throwing an instance of "frontend_failed" exception due to syntax errors detected in the input code 

Build check backstroke:

make check
make -C src
make[1]: Entering directory 'backstroke/src'
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 backstroke.C -o backstroke.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 ClassInfo.C -o ClassInfo.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 CodeGenerator.C -o CodeGenerator.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 CommandLineOptions.C -o CommandLineOptions.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 EditSequence.C -o EditSequence.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 PragmaMap.C -o PragmaMap.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 pragmaparser.C -o pragmaparser.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 TimeMeasurement.C -o TimeMeasurement.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 TransformationSequence.C -o TransformationSequence.o
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 Utility.C -o Utility.o
g++ -g -O2 -o backstroke backstroke.o ClassInfo.o CodeGenerator.o CommandLineOptions.o EditSequence.o PragmaMap.o pragmaparser.o TimeMeasurement.o TransformationSequence.o Utility.o -Lrose-dad/lib -lrose -pthread  -Lboost_1.71/lib -lboost_date_time -lboost_thread -lboost_filesystem -lboost_program_options -lboost_regex -lboost_system -lboost_serialization -lboost_wave -lboost_iostreams -lboost_chrono   -ldl  -L/usr/lib -lpython2.7 -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -lz -lpthread -ldl  -lutil                 -lm -lquadmath -L.
g++ -c -Irose-dad/include/rose                  -pthread -Iboost_1.71/include -I. -std=c++14 -fPIC -Irtss rtss/rtss.C -ortss/rtss.o
g++ rtss/rtss.o -shared -ortss/librtss.so
make[1]: Leaving directory 'backstroke/src'
make -C tests check
make[1]: Entering directory 'backstroke/tests'
Checking rtss library ...
PASS (testing Backstroke exception: reverseEvent: no existing event)
PASS (testing Backstroke exception: commitEvent: no existing event)
PASS
Checking backstroke ...
Feature test 1 
Feature test 2 
Feature test 3 
Feature test 4 
Feature test 5 
Compile Test 1 
Compile Test 2 
"/usr/include/assert.h", line 71: error: expected a "{"
       __THROW __attribute__ ((__noreturn__));
       ^

At end of source: error: expected a "}"

Errors in Processing Input File: throwing an instance of "frontend_failed" exception due to syntax errors detected in the input code 
Makefile:72: recipe for target 'backstroke.passed' failed
make[1]: *** [backstroke.passed] Error 1
make[1]: Leaving directory 'backstroke/tests'
Makefile:11: recipe for target 'check' failed
make: *** [check] Error 2

If I preprocess the hello.cpp then it succeed:

rajaChecker -c hello.cpp
"//#rose-dad/include/edg/g++_HEADERS/hdrs6/bits/libio.h", line
          435: error: expected a "{"
  extern int _IO_feof (_IO_FILE *__fp) __THROW;
                                       ^

"/usr/include/stdio.h", line 144: error: expected a "{"
  extern int remove (const char *__filename) __THROW;
                                             ^

"//#dad/hello.cpp", line 6: error: identifier
          "printf" is undefined
      printf("Hello !\n");
      ^

At end of source: error: expected a "}"

At end of source: error: expected a "}"

Errors in Processing Input File: throwing an instance of "frontend_failed" exception due to syntax errors detected in the input code 
$ rajaChecker -E hello.cpp > helloi.cpp
$ rajaChecker -c helloi.cpp

Confirming the issue still persists with stdio.h from glibc 2.36.