From owner-freebsd-questions@freebsd.org Mon Dec 3 22:10:43 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D4E4130D1DA for ; Mon, 3 Dec 2018 22:10:43 +0000 (UTC) (envelope-from byrnejb@harte-lyne.ca) Received: from mx32.harte-lyne.ca (mx32.harte-lyne.ca [216.185.71.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx32.harte-lyne.ca", Issuer "CA_HLL_ISSUER_2016" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B7A23719C3 for ; Mon, 3 Dec 2018 22:10:32 +0000 (UTC) (envelope-from byrnejb@harte-lyne.ca) Received: from mx32.harte-lyne.ca (unknown [127.0.32.1]) by mx32.harte-lyne.ca (Postfix) with ESMTP id 43A2132842 for ; Mon, 3 Dec 2018 17:10:26 -0500 (EST) X-Virus-Scanned: amavisd-new at harte-lyne.ca Received: from mx32.harte-lyne.ca ([127.0.32.1]) by mx32.harte-lyne.ca (mx32.harte-lyne.ca [127.0.32.1]) (amavisd-new, port 10024) with ESMTP id BfzSLkWkclUg for ; Mon, 3 Dec 2018 17:10:20 -0500 (EST) Received: from webmail.harte-lyne.ca (mx32.harte-lyne.ca [216.185.71.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx32.harte-lyne.ca (Postfix) with ESMTPSA id BD9A732839 for ; Mon, 3 Dec 2018 17:10:19 -0500 (EST) Received: from 216.185.71.44 (SquirrelMail authenticated user byrnejb_hll) by webmail.harte-lyne.ca with HTTP; Mon, 3 Dec 2018 17:10:19 -0500 Message-ID: <4c729c3af0c550644f1e3b32cbd7f2f9.squirrel@webmail.harte-lyne.ca> Date: Mon, 3 Dec 2018 17:10:19 -0500 Subject: clang FreeBSD question From: "James B. Byrne" To: freebsd-questions@freebsd.org Reply-To: byrnejb@harte-lyne.ca User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Rspamd-Queue-Id: B7A23719C3 X-Spamd-Result: default: False [-4.45 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[byrnejb@harte-lyne.ca]; R_SPF_ALLOW(-0.20)[+ip4:216.185.71.0/26]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[32.71.185.216.list.dnswl.org : 127.0.4.2]; DKIM_TRACE(0.00)[harte-lyne.ca:+]; HAS_X_PRIO_THREE(0.00)[3]; MX_GOOD(-0.01)[mx32.harte-lyne.ca,mx31.harte-lyne.ca,mx132.harte-lyne.ca]; DMARC_POLICY_ALLOW(-0.50)[harte-lyne.ca,quarantine]; NEURAL_HAM_SHORT(-0.72)[-0.725,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.02)[country: CA(-0.09)]; ASN(0.00)[asn:12021, ipnet:216.185.64.0/20, country:CA]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; R_DKIM_ALLOW(-0.20)[harte-lyne.ca]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 22:10:43 -0000 I am hacking an old terminal emulator program originally written for something other than FreeBSD. Ihave encountered this error: cc -I../ -I../BSDI -I/usr/include -I/usr/local/include -DSHOW_DC1_COUNT=0 -DDEBUG_BREAK=0 -DIGNORE_KEYBOARD_LOCK=1 -DIGNORE_USER_SYSTEM_LOCK=1 -DDEBUG_BLOCK_MODE=0 -DMEMLOCK_2000 -c tty.c tty.c:179:28: error: use of undeclared identifier 'CBAUD' curr_termio.c_cflag &= ~(CBAUD); The code in question looks like this: #ifdef _POSIX_SOURCE if (cfsetispeed((PTERMIO)&curr_termio, speed) == -1) { printf ("Error %d from cfsetispeed(%s)\n", errno, deviceinfo); show_tty_error ("cfsetispeed()", errno); return(-1); } if (cfsetospeed((PTERMIO)&curr_termio, speed) == -1) { printf ("Error %d from cfsetospeed(%s)\n", errno, deviceinfo); show_tty_error ("cfsetospeed()", errno); return(-1); } #else curr_termio.c_cflag &= ~(CBAUD); curr_termio.c_cflag |= speed; I can guess that FreeBSD is not a POSIX compliant OS, or at least does not declar itself so in the manner the programmer expected. However, the only other references to CBAUD that I can find on this system is: /usr/local/include/gphoto2/gphoto2-port-portability.h:99:# define CBAUD 0x0000100f /usr/local/include/gphoto2/gphoto2-port-portability.h:129:# define CBAUDEX 0x00001000 Soooo. The question is: Do I just define CBAUD by copy and paste into a header file and add that to the complier includes? Or is their a more informed and elegant answer to my problem? -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3