]> sigrok.org Git - libsigrok.git/commitdiff
serial: move sr_serial_extract_options() out of "have serial comm" condition
authorGerhard Sittig <redacted>
Wed, 22 Dec 2021 11:50:19 +0000 (12:50 +0100)
committerGerhard Sittig <redacted>
Wed, 22 Dec 2021 19:04:28 +0000 (20:04 +0100)
The sr_serial_extract_options() routine strictly operates on variables
and is applicable to any driver which accepts conn= specs. No physical
serial communication is involved, the HAVE_SERIAL_COMM condition check
is too strict a constraint.

This silences warnings in build configurations where serial communication
is not available:

   ../src/scpi/scpi.c: In function 'sr_scpi_scan':
  src/scpi/scpi.c:325 col 2: warning: implicit declaration of function 'sr_serial_extract_options' [-Wimplicit-function-declaration]
     (void)sr_serial_extract_options(options, &resource, &serialcomm);
     ^

Implementation detail: List the serial.c source file two times in the
Makefile to avoid confusion when the file is "missing" in the list of
related source files in the "serial comm supported" case. All serial.c
content already was under the HAVE_SERIAL_COMM condition, so compiling
that file in all build configurations is not an issue.


No differences found