FreeCalypso > hg > freecalypso-tools
annotate uptools/atcmd/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 | b61b81d3cece |
| children | 90d7c360a614 |
| rev | line source |
|---|---|
|
348
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 CC= gcc |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 CFLAGS= -O2 |
|
387
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
3 PROGS= fcup-at fcup-settime fcup-smdump fcup-smsend fcup-smsendmult \ |
|
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
4 fcup-smsendpdu fcup-smwrite |
|
348
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 INSTBIN=/opt/freecalypso/bin |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 LIBCODING= ../libcoding/libcoding.a |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 ATCMD_OBJS= atcmd.o atinterf.o |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
|
387
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
11 SETTIME_OBJS= atinterf.o settime.o |
|
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
12 |
|
352
02d6c8469535
fcup-smdump implemented, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
348
diff
changeset
|
13 SMDUMP_OBJS= atinterf.o resp_parse.o smdump.o ${LIBCODING} |
|
02d6c8469535
fcup-smdump implemented, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
348
diff
changeset
|
14 |
|
370
076d533f840d
fcup-smsend: implemented automatic concat SMS refno generation
Mychaela Falconia <falcon@freecalypso.org>
parents:
366
diff
changeset
|
15 SMSEND_OBJS= atinterf.o resp_parse.o smsend_cmgw.o smsend_concat.o \ |
|
379
a38805b5b6d4
uptools/atcmd: smsend_pdugen.c split off from smsend_pduout.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
373
diff
changeset
|
16 smsend_main.o smsend_pdugen.o smsend_pduout.o smsend_text.o \ |
|
a38805b5b6d4
uptools/atcmd: smsend_pdugen.c split off from smsend_pduout.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
373
diff
changeset
|
17 ${LIBCODING} |
|
362
89fe66cb60f6
fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
352
diff
changeset
|
18 |
|
373
1fa4dcbb1c87
fcup-smsendmult program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
372
diff
changeset
|
19 SMSENDM_OBJS= atinterf.o resp_parse.o smsend_cmgw.o smsend_multmain.o \ |
|
379
a38805b5b6d4
uptools/atcmd: smsend_pdugen.c split off from smsend_pduout.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
373
diff
changeset
|
20 smsend_pdugen.o smsend_pduout.o smsend_text.o ${LIBCODING} |
|
373
1fa4dcbb1c87
fcup-smsendmult program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
372
diff
changeset
|
21 |
|
384
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
22 SMSENDP_OBJS= atinterf.o resp_parse.o smsend_cmgw.o smsend_pduin.o \ |
|
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
23 smsend_pduout.o ${LIBCODING} |
|
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
24 |
|
385
ce3b57b8920b
fcup-smwrite program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
384
diff
changeset
|
25 SMWRITE_OBJS= atinterf.o smwrite.o ${LIBCODING} |
|
ce3b57b8920b
fcup-smwrite program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
384
diff
changeset
|
26 |
|
348
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 all: ${PROGS} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 fcup-at: ${ATCMD_OBJS} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 ${CC} ${CFLAGS} -o $@ ${ATCMD_OBJS} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
|
387
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
32 fcup-settime: ${SETTIME_OBJS} |
|
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
33 ${CC} ${CFLAGS} -o $@ ${SETTIME_OBJS} |
|
b61b81d3cece
fcup-settime program written, compiles, produces expected AT+CCLK command
Mychaela Falconia <falcon@freecalypso.org>
parents:
385
diff
changeset
|
34 |
|
352
02d6c8469535
fcup-smdump implemented, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
348
diff
changeset
|
35 fcup-smdump: ${SMDUMP_OBJS} |
|
02d6c8469535
fcup-smdump implemented, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
348
diff
changeset
|
36 ${CC} ${CFLAGS} -o $@ ${SMDUMP_OBJS} |
|
02d6c8469535
fcup-smdump implemented, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
348
diff
changeset
|
37 |
|
362
89fe66cb60f6
fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
352
diff
changeset
|
38 fcup-smsend: ${SMSEND_OBJS} |
|
89fe66cb60f6
fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
352
diff
changeset
|
39 ${CC} ${CFLAGS} -o $@ ${SMSEND_OBJS} |
|
89fe66cb60f6
fcup-smsend program put together, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
352
diff
changeset
|
40 |
|
373
1fa4dcbb1c87
fcup-smsendmult program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
372
diff
changeset
|
41 fcup-smsendmult: ${SMSENDM_OBJS} |
|
1fa4dcbb1c87
fcup-smsendmult program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
372
diff
changeset
|
42 ${CC} ${CFLAGS} -o $@ ${SMSENDM_OBJS} |
|
1fa4dcbb1c87
fcup-smsendmult program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
372
diff
changeset
|
43 |
|
384
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
44 fcup-smsendpdu: ${SMSENDP_OBJS} |
|
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
45 ${CC} ${CFLAGS} -o $@ ${SMSENDP_OBJS} |
|
3eb92855f7b9
fcup-smsendpdu program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
379
diff
changeset
|
46 |
|
385
ce3b57b8920b
fcup-smwrite program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
384
diff
changeset
|
47 fcup-smwrite: ${SMWRITE_OBJS} |
|
ce3b57b8920b
fcup-smwrite program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
384
diff
changeset
|
48 ${CC} ${CFLAGS} -o $@ ${SMWRITE_OBJS} |
|
ce3b57b8920b
fcup-smwrite program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
384
diff
changeset
|
49 |
|
348
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 install: ${PROGS} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 mkdir -p ${INSTBIN} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 install -c ${PROGS} ${INSTBIN} |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 clean: |
|
64dcbabd48ca
uptools/atcmd framework started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 rm -f *.o *.out *errs ${PROGS} |
