Bug 418456 - Incorrect Undefined Symbol if symbol was previously defined in another source file
Summary: Incorrect Undefined Symbol if symbol was previously defined in another source...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.2.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-01 16:24 EDT by Joseph Henry CLA
Modified: 2020-09-04 15:26 EDT (History)
4 users (show)

See Also:


Attachments
Project for recreate the bug (9.11 KB, application/octet-stream)
2013-10-01 16:24 EDT, Joseph Henry CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Henry CLA 2013-10-01 16:24:27 EDT
Created attachment 236022 [details]
Project for recreate the bug

Lets say I have file a.h

#ifndef A_H_
#define A_H_

#define SYMBOL 1

#endif

And file common.h

#ifndef COMMON_H_
#define COMMON_H_

#if !defined(SYMBOL)
#define SYMBOL 2
#endif

#define COMMON

#endif

If I have file a.c:

#include "a.h"

#include "common.h"

int* a = SYMBOL;

and b.c:

#include "common.h"

int* b = SYMBOL;

b.c will say the SYMBOL is undefined.

This does not matter whether or not it is in the form of #ifndef SYMBOL or #if !defined(SYMBOL)