Menu

ctuOneDefinitionRuleViolation false positive?

2025-06-09
2025-06-10
  • James K. Lowden

    James K. Lowden - 2025-06-09
    ../../gcc/cobol/symbols.h:158:1: error: The one definition rule is violated, different classes/structs have the same name 'cbl_domain_elem_t' [ctuOneDefinitionRuleViolation]
    class cbl_domain_elem_t {
    ^
    /home/jklowden/projects/3rd/gcc/parser/gcc/cobol/symbols.h:158:1: note: The one definition rule is violated, different classes/structs have the same name 'cbl_domain_elem_t'
    class cbl_domain_elem_t {
    ^
    ../../gcc/cobol/symbols.h:158:1: note: The one definition rule is violated, different classes/structs have the same name 'cbl_domain_elem_t'
    class cbl_domain_elem_t {
    ^
    

    One of us is confused. :-)

    This message derives from building gcobol, the gcc COBOL FE. There is only one file symbols.h. The complaint appears to stem from that single file being referenced in two ways, once with an absolute path and once with a relative path. (I assume the second note is meant to refer to the conflicting definition, but it refers to the same file and line number.)

    If this is a real error, could you tell me how to expose the conflicting definitions? If it is not, could you kindly leave a comment for the open PR?

     
  • CHR

    CHR - 2025-06-10

    Can you tell which source file symbol.h is referenced from? It should appear somewhere in the output before the ODR warning. Once you know the file, looking at the preprocessor output (-E) might be helpful.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.