From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13452 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Sykes Newsgroups: gmane.linux.lib.musl.general Subject: optopt in getopt not being set, only when building with OpenWrt Date: Fri, 16 Nov 2018 17:54:23 +0800 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1542361964 30511 195.159.176.226 (16 Nov 2018 09:52:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 09:52:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13468-gllmg-musl=m.gmane.org@lists.openwall.com Fri Nov 16 10:52:40 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gNano-0007qn-3D for gllmg-musl@m.gmane.org; Fri, 16 Nov 2018 10:52:40 +0100 Original-Received: (qmail 15437 invoked by uid 550); 16 Nov 2018 09:54:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 15402 invoked from network); 16 Nov 2018 09:54:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7BY3S8MhArOYNwH+7MJe+5ufB2GCFPy8+CvhEJpX7Ss=; b=T9bxGRBnveFxLkgTs0tpVDHlUWZh5UQlqq0tiIeYK5N6zut24rD6rA9Po0zSxa6Ycj s2YKhkYntXWFYHRJtFp4GrGZg8e9m8kFKXQh6p4bpEcbf1lRaStNeImtOj/TtPLc0Nn9 UAsfqML5/aACF1BwAgcN6B6gYnLrCjuftJWEWqxxE1SeFmMu3OgTgPHym1dcz8Ys9ucG MMlZkka+M9JupT/IOhzF/FZq+THx6pfjTpJldO5S8AXHPWNqmOyaJNLnzhfELUYlDLNW WUZidsYoeuLH6ZGJ3/jjM9ugWGexAPbt6n9a5bLyNMy5w/62mfF5xjUUgpOVJf0umRIX NJFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7BY3S8MhArOYNwH+7MJe+5ufB2GCFPy8+CvhEJpX7Ss=; b=fM0P/i9yb0HbDWV1LQ5GMRB3SOC3Ach/BzwnHvBXRJgFftSIE7em7s9hoHhtjBXy3D u7IuuMXb1Ng1Dqs+eEWP2k8I60Tr2GTaD1sGeRqrzlCEWacgMZKD5Fm1g0Dh/mtKdScy 0nzJ6EtzlK5++Tz5NAhqkOBIcoP+EEpa2a+kh5+w5ap8SW8NUgjB0nnzXGfcY9ZOV6ZN QSDQooUl33qQcukv5G7OpKihv/d2Tti7dao4ZBGymKs/Vf5aQ2AMibdb09UGp0Tf4iXZ v37/sIl3bvDV2Gfgfds8jjHJiIwDLcj5F00KHoeP6AoKU3649wvSsgMnynFH6DV/ZrVP +zfQ== X-Gm-Message-State: AGRZ1gKTDD5VN04r7S1Y4uMwuKunXOKzD2I/EH0KOBhuUIpOhtMWwpVc wa8qr0x6GresiAV0LXhtfC9tmqRtcjpXW4qDuSXVvA== X-Google-Smtp-Source: AJdET5eNDO3I8Fj0zY0DgHnar5bGLg1x7mLPB5pgF1AujT5v9iKpyFG9FGTH4/EfOUMVLMjRWWeyqWXV81R0KyST4YY= X-Received: by 2002:a81:54d5:: with SMTP id i204-v6mr9163651ywb.87.1542362075748; Fri, 16 Nov 2018 01:54:35 -0800 (PST) Xref: news.gmane.org gmane.linux.lib.musl.general:13452 Archived-At: Hi, First post to the list, apologies in advance for any etiquette transgressions. On my OpenWrt builds I found that the optopt variable was never set when calling the function getopt. I tested the same code on my desktop using the gcc wrapper and optopt was set as expected. Debugging showed that optopt was being set correctly in getopt.c however the variable was not being set in my calling code. Adding optopt to the file 'dynamic.list' resolved the issue when building with OpenWrt. I noticed that all the other extern variables for getopt appear in dynamic.list except optopt. Paul.