File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Repository: https://github.com/capnramses/pro_programming_tools_c_cpp
99/* trivial function to add two integers */
1010int my_adder ( int a , int b ) { return a + b ; }
1111
12- void run_tests () {
12+ void run_tests ( void ) {
1313 int a_inputs [3 ] = { 0 , 100 , -100 };
1414 int b_inputs [3 ] = { 0 , -200 , 200 };
1515 int expected_outputs [3 ] = { 0 , -100 , 100 };
Original file line number Diff line number Diff line change @@ -44,12 +44,12 @@ Getting the list of strings in the stack trace requires system-specific calls.
4444
4545int * ptr = NULL ;
4646
47- void function_that_crashed () {
47+ void function_that_crashed ( void ) {
4848 int value = * ptr ; // should crash here. dereferencing a null pointer.
4949 printf ( "value %i\n" , value );
5050}
5151
52- void some_intermediate_function () { function_that_crashed (); }
52+ void some_intermediate_function ( void ) { function_that_crashed (); }
5353
5454int main ( void ) {
5555 some_intermediate_function ();
Original file line number Diff line number Diff line change @@ -15,21 +15,21 @@ To tabulate profiling results after running:
1515
1616#include <stdio.h>
1717
18- void great_greatchild () {
18+ void great_greatchild ( void ) {
1919 for ( int i = 0 ; i < 0x10000000 ; i ++ ) { ; }
2020}
2121
22- void grandchild () {
22+ void grandchild ( void ) {
2323 for ( int i = 0 ; i < 0x1000000 ; i ++ ) { ; }
2424 great_greatchild ();
2525}
2626
27- void child () {
27+ void child ( void ) {
2828 for ( int i = 0 ; i < 0x100000 ; i ++ ) { ; }
2929 grandchild ();
3030}
3131
32- void parent () {
32+ void parent ( void ) {
3333 for ( int i = 0 ; i < 0x1000 ; i ++ ) { ; }
3434 child ();
3535}
You can’t perform that action at this time.
0 commit comments