Skip to content

Commit b860b20

Browse files
committed
build: use -Wall -Wextra -pedantic
1 parent 9ea3ebf commit b860b20

File tree

6 files changed

+12
-25
lines changed

6 files changed

+12
-25
lines changed

Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
all: fib gcd list conditional church
2-
3-
church: church.cpp church.hpp
4-
$(CXX) -o $@ $<
5-
6-
conditional: conditional.cpp conditional.hpp
7-
$(CXX) -o $@ $<
1+
CXXFLAGS += -Wextra -Wall -pedantic
82

9-
list: list.cpp list.hpp
10-
$(CXX) -o $@ $<
11-
12-
fib: fib.cpp fib.hpp
13-
$(CXX) -o $@ $<
14-
15-
gcd: gcd.cpp gcd.hpp
16-
$(CXX) -o $@ $<
3+
all: fib gcd list conditional church
174

185
.PHONY: clean
19-
clean:
6+
clean:
207
-rm -rf fib *.o gcd list conditional church

README.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
This is a collection of test programs that play around with C++ template metaprogramming.
22

33
Most of the interesting stuff is in list.{c,h}pp
4-
In there is a LIST datastructure that can generate compile time lists of ints
4+
In there is a LIST data structure that can generate compile time lists of ints
55
(stored in typedefs) over which computations or code can be generated at
6-
compile time. The coolest example in there is the compile time mergesort.
6+
compile time. The coolest example in there is the compile time merge-sort.
77

88
There is the start of some church encoding experiments in church.{c,h}pp
99

10-
There is a basic compile time fibonacci generator in fib.{c,h}pp
10+
There is a basic compile time Fibonacci generator in fib.{c,h}pp
1111

1212
There is a compile time GCD calculator in gcd.{c,h}pp
1313

conditional.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ struct B {
1010
};
1111

1212
struct A1 {
13-
static inline int EXEC(void) {
13+
static inline void EXEC(void) {
1414
std::cout << "TRUE!";
1515
}
1616
};
1717

1818
struct B1 {
19-
static inline int EXEC(void) {
19+
static inline void EXEC(void) {
2020
std::cout << "FALSE!";
2121
}
2222
};
2323

24-
int main(int argc, char **argv) {
24+
int main() {
2525
std::cout << "true = " << IF<true, A, B>::TEST::RESULT << std::endl;
2626
std::cout << "true = " << IF<false, A, B>::TEST::RESULT << std::endl;
2727

fib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <iostream>
22
#include "fib.hpp"
33

4-
int main(int argc, char **argv) {
4+
int main() {
55
std::cout << "Fib 5:" << FIB<5>::RESULT << std::endl;
66
}

gcd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <iostream>
22
#include "gcd.hpp"
33

4-
int main(int argc, char **argv) {
4+
int main() {
55
std::cout << "GCD (25,50) == " << GCD<25, 50>::RESULT << std::endl;
66
}

list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <int a, int b> struct ORD {
3232
static const bool VALUE = a < b;
3333
};
3434

35-
int main(int argc, char **argv) {
35+
int main() {
3636

3737
/* The best example */
3838
std::cout << "The list is: ";

0 commit comments

Comments
 (0)