HarveyHunt / howm

A lightweight, X11 tiling window manager that behaves like vim
GNU General Public License v2.0
651 stars 24 forks source link

Added some static asserts. #18

Closed HarveyHunt closed 10 years ago

HarveyHunt commented 10 years ago

Opinions on this would be useful:

_Static_assert compiles fine under both GCC and Clang, so we don't need to worry about that. :-)

anubhavcodes commented 10 years ago

1) As the config.h options will be modified by users of howm, putting static asserts in config.h seems to be the most appropriate idea.

2) Static asserts can also be added to check the things in the arrays of config.h, but since they won't be modified much by the users, using a test case mechanisms (unit tests or regression tests for arrays) seems wise here. We can have a look at cunit and other packages for testing available for C. But using static asserts should also work for this use case. This is just my opinion.

HarveyHunt commented 10 years ago
  1. Okay, I agree with that so the asserts will stay where they are.
  2. I am rather scared about adding unit tests to howm, I think we will end up with lots of code and it will be hard to ensure code works correctly with the X server- a big part of howm. I think I will add some more static asserts to config.h, but I don't want run time tests really, as people aren't going to see the output of howm.
anubhavcodes commented 10 years ago

Okay, then static asserts for checking the arrays sounds good!

HarveyHunt commented 10 years ago

All done, time to merge. :+1: