ImportC and color syntax highlighting

Walter Bright newshound2 at digitalmars.com
Sun Sep 12 09:14:13 UTC 2021


On 9/11/2021 4:04 PM, jfondren wrote:
> On Saturday, 11 September 2021 at 22:25:31 UTC, Walter Bright wrote:
>> Now that I'm writing C test cases again (for #ImportC), the lack of color 
>> syntax highlighting was annoying. Fixed it:
>>
>> https://github.com/DigitalMars/med/commit/adcc084e21427236957a7f94f3547b22a89c7c1c 
>>
>>
>> and did C++ while I was at it.
> 
> Neat, I wasn't aware of this.
> 
> It's a little bit annoying to compile from source as my distro's dmd/ldc2 
> packages don't include 32-bit libraries but this doesn't build under -m32, and 
> gdc doesn't come with gdmd. But with gdmd, it builds out of master with
> 
> ```
> make DMD=gdmd -f linux.mak
> ```
> 
> It only has one v1.0.0 tag from 2014, so `dub run med` fails with a bunch of 
> ancient errors:
> ```
> .dub/packages/med-1.0.0/med/src/med/buffer.d(254,16): Error: instead of C-style 
> syntax, use D-style `dchar[6 + 1] b
> ```
> 
> meanwhile `dub run med@~master --compiler=gdc --arch=x86` pulls the latest code 
> but can't build due to -Werror and some "statement is not reachable" warnings.
> 
> When running it, it pegs a CPU at 100% because it's constantly running 
> ttkeysininput(). That's enough to cause a fan to run at high speed on this 
> laptop. But, that's easily fixed with select() or similar against stdin.

Thanks. I'll see what I can do. I've never heard of select().


More information about the Digitalmars-d mailing list