Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all compile-time warnings #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kfogel
Copy link
Member

@kfogel kfogel commented Sep 5, 2018

Before this change:

  $ make
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                                  -DDCLEDVERSION='"2.2"' \
                                  -I/usr/include/libusb-1.0 dcled.c
  dcled.c: In function ‘open_usbdev’:
  dcled.c:265:3: warning: ‘libusb_set_debug’ is deprecated: \
                 Use libusb_set_option instead [-Wdeprecated-declarations]
     libusb_set_debug(NULL,3);
     ^~~~~~~~~~~~~~~~
  In file included from dcled.c:30:
  /usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
   void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                    ^~~~~~~~~~~~~~~~
  dcled.c: In function ‘printBCDchar’:
  dcled.c:409:7: warning: implicit declaration of function ‘isdigit’ \
                 [-Wimplicit-function-declaration]
    if (!isdigit(c)) {
         ^~~~~~~
  dcled.c: In function ‘savefonts’:
  dcled.c:1375:30: warning: implicit declaration of function ‘isgraph’ \
                   [-Wimplicit-function-declaration]
      fprintf(out,"%02x %c ",i,(isgraph(i)?i:'.'));
                                ^~~~~~~
  gcc dcled.o -o dcled -g -lm -lusb-1.0
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                                  -DDCLEDVERSION='"2.2"' \
                                  -I/usr/include/libusb-1.0 cpuload.c
  cpuload.c: In function ‘main’:
  cpuload.c:85:7: warning: implicit declaration of function ‘strcmp’ \
                  [-Wimplicit-function-declaration]
     if(!strcmp(tag,"cpu ")) {
         ^~~~~~
  gcc cpuload.o -o cpuload -g -lm -lusb-1.0
  $

After this change:

  $ make
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                -DDCLEDVERSION='"2.2"' -I/usr/include/libusb-1.0 dcled.c
  gcc dcled.o -o dcled -g -lm -lusb-1.0
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                -DDCLEDVERSION='"2.2"' -I/usr/include/libusb-1.0 cpuload.c
  gcc cpuload.o -o cpuload -g -lm -lusb-1.0
  $

Before this change:

  $ make
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                                  -DDCLEDVERSION='"2.2"' \
                                  -I/usr/include/libusb-1.0 dcled.c
  dcled.c: In function ‘open_usbdev’:
  dcled.c:265:3: warning: ‘libusb_set_debug’ is deprecated: \
                 Use libusb_set_option instead [-Wdeprecated-declarations]
     libusb_set_debug(NULL,3);
     ^~~~~~~~~~~~~~~~
  In file included from dcled.c:30:
  /usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
   void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                    ^~~~~~~~~~~~~~~~
  dcled.c: In function ‘printBCDchar’:
  dcled.c:409:7: warning: implicit declaration of function ‘isdigit’ \
                 [-Wimplicit-function-declaration]
    if (!isdigit(c)) {
         ^~~~~~~
  dcled.c: In function ‘savefonts’:
  dcled.c:1375:30: warning: implicit declaration of function ‘isgraph’ \
                   [-Wimplicit-function-declaration]
      fprintf(out,"%02x %c ",i,(isgraph(i)?i:'.'));
                                ^~~~~~~
  gcc dcled.o -o dcled -g -lm -lusb-1.0
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                                  -DDCLEDVERSION='"2.2"' \
                                  -I/usr/include/libusb-1.0 cpuload.c
  cpuload.c: In function ‘main’:
  cpuload.c:85:7: warning: implicit declaration of function ‘strcmp’ \
                  [-Wimplicit-function-declaration]
     if(!strcmp(tag,"cpu ")) {
         ^~~~~~
  gcc cpuload.o -o cpuload -g -lm -lusb-1.0
  $

After this change:

  $ make
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                -DDCLEDVERSION='"2.2"' -I/usr/include/libusb-1.0 dcled.c
  gcc dcled.o -o dcled -g -lm -lusb-1.0
  gcc -c -g -O3 -Wunused-variable -DFONTDIR='"/usr/local/share/dcled"' \
                -DDCLEDVERSION='"2.2"' -I/usr/include/libusb-1.0 cpuload.c
  gcc cpuload.o -o cpuload -g -lm -lusb-1.0
  $
@kfogel
Copy link
Member Author

kfogel commented Sep 5, 2018

I'm probably not going to merge this pull request into the Conservatory copy of the code. At the same time, though I'm not prepared to take over maintenance of dcled. So I'm just making the PR visible for now, in case anyone else runs into these compile-time warnings. If I hear from other folks here, that'll be a sign that maybe I should actively maintain @kfogel/dcled after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant