Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I ensure my code compiles with both DMD and GDC?

Tags:

d

dmd

gdc

I guess partially equivalent question: Should code that compiles with DMD, automatically compile in all circumstances with GDC?

I ask because I'm having issues getting a modern version of GDC installed from ubuntu 10.4 (seemingly cyclic dependencies, sigh) reposetory.

like image 488
deltaluca Avatar asked Dec 04 '25 17:12

deltaluca


1 Answers

Should I ensure my code compiles with both DMD and GDC?

Depends if you plan on compiling code on both those compilers. If you only intend to compile with DMD then there's no need to make sure your code compiles on GDC. That said, it's usually a good idea to write code that is portable across compilers just in case you do need to use GDC one day.

Should code that compiles with DMD, automatically compile in all circumstances with GDC?

Mostly, but there are, and always will be small differences between compilers.

GDC and DMD (and LDC) all share the same compiler front end, so for the most part they will be feature equivalent. The differences usually come in when you start to touch lower-level stuff e.g. inline assembler, SIMD intrinsics.

like image 148
Peter Alexander Avatar answered Dec 07 '25 07:12

Peter Alexander



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!