Skip to content

Commit 41d7c1c

Browse files
committed
Add CI step to verify global names
1 parent 5482eb7 commit 41d7c1c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ jobs:
3535
- name: Unit test
3636
run: make -C src unit-test
3737

38+
- name: Global name verification
39+
run: make -C src verify-global-defs
40+
3841
- name: End-to-end test
3942
run: make -C src e2e-test

src/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ rl_driver: rl_driver.c
8080
$(SHARED_LIB): $(RL_SRC)
8181
$(CC) $(SHARED_FLAGS) $(CFLAGS) $(LDFLAGS) $(RL_SRC) -o $@ -ldl $(SHARED_LIB_LIB)
8282

83+
verify-global-defs: # Help: Verify prefix of globally visible definitions
84+
$(CC) $(CFLAGS) $(RL_SRC) -c
85+
# Check that global not undefined (U) definitions are prefixed
86+
# The output (grep success) signifies unprefixed global defs
87+
! nm *.o | sed 's/^ /x/' | awk '$$2 ~ /[A-TVZ]/ {print $$3}' | grep -Ev '^(acl|ini|curl)'
88+
8389
e2e-run: $(PROGS) # Help: Invoke the library with a readline read/print loop
8490
$(PRELOAD_VAR)=`pwd`/$(SHARED_LIB) $(SET_ADD_LIB) ./rl_driver
8591

0 commit comments

Comments
 (0)