Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Emmankoko
Copy link
Contributor

@Emmankoko Emmankoko commented Nov 3, 2025

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Emmankoko! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#22056"

@Emmankoko Emmankoko force-pushed the id branch 2 times, most recently from 5d16db3 to 4998e22 Compare November 3, 2025 12:32
@Emmankoko Emmankoko marked this pull request as ready for review November 3, 2025 18:14
@Emmankoko Emmankoko requested a review from ibuclaw as a code owner November 3, 2025 18:14
Comment on lines +5744 to +5746
version( Windows)
{
if (idx == "complex" || identx == "complex")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the test for this? Why is this here?

Comment on lines +5720 to +5724
/* check for compiler builtins macros/ or specifier references.
* this is a workaround to avoid trying to resolve macros that
* reference other identifiers or functions
* so D users should avoid using custom macros beginning with __
* to reference identifers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why workaround? GDC knows what all these built-ins are so is not in the best interest to skip them.

Copy link
Contributor Author

@Emmankoko Emmankoko Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it ends up in a lot of undefined identifiers. especially when compiling druntime

//}
}

bool isCmacrosame(const(char)[] idx, const(char)[] ident)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function really needed when all it's doing is id1 == id2?

Dsymbol *aliassym;
Dsymbol *overnext; // next in overload list
Dsymbol *_import; // !=NULL if unresolved internal alias for selective import
bool isCmacro;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use bool in C++ for field members, it's a variable sized type, resulting in an incompatible class layout on some targets such as darwin/ppc.

Suggested change
bool isCmacro;
d_bool isCmacro;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted.

* probably a builtin one we don't define
* stop processing it. C macro refering identifiers
* can point to absolutely anything either defined or not
* #ifdefine hsgshsh hsshhshs is a valid C compile but emit on usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this comment even mean?

Copy link
Contributor Author

@Emmankoko Emmankoko Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes macros can be defined actually referring to nothing and doesn't err on compilation and can disturb importC. it can lead to breaking D semantics. so we avoid those too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImportC: Macros inside a typedef enum not seen

3 participants