FreeCalypso > hg > freecalypso-tools
annotate miscutil/Makefile @ 465:003e48f8ebe1
rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel
I generally don't use NULL and use plain 0 instead, based on a "NULL
considered harmful" discussion on the classiccmp mailing list many aeons
ago (I couldn't find it, and I reason that it must have been 2005 or
earlier), but a recent complaint by a packager sent me searching, and I
found this:
https://ewontfix.com/11/
While I don't give a @#$% about "modern" systems and code-nazi tools,
I realized that passing a plain 0 as a pointer sentinel in execl is wrong
because it will break on systems where pointers are longer than the plain
int type. Again, I don't give a @#$% about the abomination of x86_64 and
the like, but if anyone ever manages to port my code to something like a
PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0
as a function argument where a pointer is expected most definitely won't
work: if the most natural stack slot and SP alignment unit is 16 bits,
fitting an int, with longs and pointers taking up two such slots, then
the call stack will be totally wrong with a plain 0 passed for a pointer.
Casting the 0 to (char *) ought to be the most kosher solution for the
most retro systems possible.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 00:00:19 +0000 |
parents | a5dab452be0d |
children | 90d7c360a614 |
rev | line source |
---|---|
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 CC= gcc |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 CFLAGS= -O2 |
412
a5dab452be0d
mokosrec2bin utility imported from the old freecalypso-reveng tree,
Mychaela Falconia <falcon@freecalypso.org>
parents:
251
diff
changeset
|
3 PROGS= fc-fr2tch fc-gsm2vm fc-rgbconv fc-serterm fc-tch2fr fc-vm2hex imei-luhn\ |
a5dab452be0d
mokosrec2bin utility imported from the old freecalypso-reveng tree,
Mychaela Falconia <falcon@freecalypso.org>
parents:
251
diff
changeset
|
4 mokosrec2bin |
59
819335e06fd1
c139explore and pirexplore host wrapper shell scripts added
Mychaela Falconia <falcon@freecalypso.org>
parents:
47
diff
changeset
|
5 SCRIPTS=c139explore pirexplore |
47
bfcc5a286459
miscutil/Makefile: move to /opt/freecalypso/bin
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
6 INSTBIN=/opt/freecalypso/bin |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 all: ${PROGS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
5
7eaa3307e5df
fc-fr2tch utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
10 FR2TCH_OBJS= fc-fr2tch.o gsm0610.o |
171
f736f3ce8310
fc-gsm2vm utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
170
diff
changeset
|
11 GSM2VM_OBJS= fc-gsm2vm.o gsm0610.o |
6
d57f68d0568d
fc-tch2fr utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
5
diff
changeset
|
12 TCH2FR_OBJS= fc-tch2fr.o gsm0610.o |
251
fb577c31e960
fc-serterm converted to use libserial
Mychaela Falconia <falcon@freecalypso.org>
parents:
171
diff
changeset
|
13 SERTERM_OBJS= fc-serterm.o ttypassthru.o ../libserial/libserial.a |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
5
7eaa3307e5df
fc-fr2tch utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
15 fc-fr2tch: ${FR2TCH_OBJS} |
7eaa3307e5df
fc-fr2tch utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
16 ${CC} ${CFLAGS} -o $@ ${FR2TCH_OBJS} |
7eaa3307e5df
fc-fr2tch utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
0
diff
changeset
|
17 |
171
f736f3ce8310
fc-gsm2vm utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
170
diff
changeset
|
18 fc-gsm2vm: ${GSM2VM_OBJS} |
f736f3ce8310
fc-gsm2vm utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
170
diff
changeset
|
19 ${CC} ${CFLAGS} -o $@ ${GSM2VM_OBJS} |
f736f3ce8310
fc-gsm2vm utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
170
diff
changeset
|
20 |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 fc-rgbconv: fc-rgbconv.c |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 ${CC} ${CFLAGS} -o $@ $@.c |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 fc-serterm: ${SERTERM_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 ${CC} ${CFLAGS} -o $@ ${SERTERM_OBJS} |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ttypassthru.o: ../loadtools/ttypassthru.c |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 ${CC} ${CFLAGS} -c -o $@ $< |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 |
6
d57f68d0568d
fc-tch2fr utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
5
diff
changeset
|
30 fc-tch2fr: ${TCH2FR_OBJS} |
d57f68d0568d
fc-tch2fr utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
5
diff
changeset
|
31 ${CC} ${CFLAGS} -o $@ ${TCH2FR_OBJS} |
d57f68d0568d
fc-tch2fr utility written, added under miscutil
Mychaela Falconia <falcon@freecalypso.org>
parents:
5
diff
changeset
|
32 |
170
a72bbc3ace09
fc-vm2hex utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
59
diff
changeset
|
33 fc-vm2hex: fc-vm2hex.c |
a72bbc3ace09
fc-vm2hex utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
59
diff
changeset
|
34 ${CC} ${CFLAGS} -o $@ $@.c |
a72bbc3ace09
fc-vm2hex utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
59
diff
changeset
|
35 |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 imei-luhn: imei-luhn.c |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 ${CC} ${CFLAGS} -o $@ $@.c |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
412
a5dab452be0d
mokosrec2bin utility imported from the old freecalypso-reveng tree,
Mychaela Falconia <falcon@freecalypso.org>
parents:
251
diff
changeset
|
39 mokosrec2bin: mokosrec2bin.c |
a5dab452be0d
mokosrec2bin utility imported from the old freecalypso-reveng tree,
Mychaela Falconia <falcon@freecalypso.org>
parents:
251
diff
changeset
|
40 ${CC} ${CFLAGS} -o $@ $@.c |
a5dab452be0d
mokosrec2bin utility imported from the old freecalypso-reveng tree,
Mychaela Falconia <falcon@freecalypso.org>
parents:
251
diff
changeset
|
41 |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 install: |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 mkdir -p ${INSTBIN} |
59
819335e06fd1
c139explore and pirexplore host wrapper shell scripts added
Mychaela Falconia <falcon@freecalypso.org>
parents:
47
diff
changeset
|
44 install -c ${PROGS} ${SCRIPTS} ${INSTBIN} |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 clean: |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 rm -f ${PROGS} *.o *errs *.out |