Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9331

rootcint doesn't return with an error code when encountering a syntax error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 6.16/00, 6.14/06
    • 6.10/04, 6.12/06
    • Dictionaries
    • None
    • Tried this on x86_64-slc6-gcc62-opt, but the platform shouldn't matter.

    Description

      Hi,

      We found this issue in one of the ATLAS offline software merge requests:

      https://its.cern.ch/jira/browse/ATLINFR-2341

      Which turns out to come from something I'd call a bug, in rootcint itself. You can simply reproduce the behaviour for instance with these two classes:

      MyClass.h

      // Dear emacs, this is -*- c++ -*-
      #ifndef ROOTCLINGTEST_MYCLASS_H
      #define ROOTCLINGTEST_MYCLASS_H
       
      /// Simple test class for the dictionary generator
      class MyClass {
       
      public:
         /// Default constructor
         MyClass();
       
         /// Simple member variable
         int m_member;
       
      }; // class MyClass
       
      #endif // ROOTCLINGTEST_MYCLASS_H
      

      LinkDef.h

      // Dear emacs, this is -*- c++ -*-
      #ifdef __CINT__
       
      #ppragma link off all globals;
      #pragma link off all classes;
      #pragma link off all functions;
       
      #pragma link C++ class MyClass+;
       
      #endif // __CINT__
      

      Running rootcint with these results in:

      [bash][pcadp02]:rootcling > rootcint -f Dictionary.cxx MyClass.h LinkDef.h
      In file included from <<< cling interactive line includer >>>:2:
      ./LinkDef.h:4:2: error: invalid preprocessing directive
      #ppragma link off all globals;
       ^
      [bash][pcadp02]:rootcling > echo $?
      0
      [bash][pcadp02]:rootcling > 
      

      Of course we'd prefer rootcint returning with a non-zero code in this case.

      Cheers,
      Attila

      Attachments

        Activity

          People

            dpiparo Danilo Piparo
            akraszna Attila Krasznahorkay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Actual End: