wgtdkp / wgtcc

A small C11 compiler
MIT License
765 stars 130 forks source link

Can't compile by clang #20

Closed meritozh closed 7 years ago

meritozh commented 7 years ago

Such as the line 11 in code_gen.h, it should add template<> before class Evaluator<Addr>. And in cpp.cc, the variable cond type of is int, but ppCondStack_.push() need a bool type parameter. Casting a int to bool is not valid.

clang is so different with gcc?

wgtdkp commented 7 years ago

I have made both clang++ and g++ happy :) Pull down the latest commit to make sure it works for you :)

wgtdkp commented 7 years ago

The errors and warnings indicate that clang++ is always right when it differs to g++. I will switch to use clang for it gives much more constraints which helps to write better code

meritozh commented 7 years ago

All is well, thanks for your work.