Skip to content

absolute and relative header paths aren't resolved to be the same header #402

Closed
@Tal500

Description

@Tal500

When including "#pragma once" header twice, once in absolute path and once in relative paths, simplecpp doesn't resolve the header to be the same, and therefore includes it twice. Example:

test.hh:

#pragma once

9

test.cc:

#include "test.hh"
#include "{YOUR_CURRENT_DIR_HERE}/test.hh"

gcc -E full output:

# 1 "test.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "test.cc"
# 1 "test.hh" 1


9
# 2 "test.cc" 2

simplecpp full output:

#line 3 "test.hh"
9
#line 3 "{YOUR_CURRENT_DIR_HERE}/test.hh"
9

Thread: https://sourceforge.net/p/cppcheck/discussion/general/thread/c01f80556b/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions