From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10395 Path: news.gmane.org!.POSTED!not-for-mail From: Per Johansson Newsgroups: gmane.linux.lib.musl.general Subject: syslog.h prioritynames define not compatible with -Wwrite-strings Date: Thu, 25 Aug 2016 09:47:06 +0200 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 1472135775 18156 195.159.176.226 (25 Aug 2016 14:36:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2016 14:36:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10408-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 25 16:36:11 2016 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 1bcvlK-0004D9-5W for gllmg-musl@m.gmane.org; Thu, 25 Aug 2016 16:36:10 +0200 Original-Received: (qmail 28210 invoked by uid 550); 25 Aug 2016 14:36:08 -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 20055 invoked from network); 25 Aug 2016 07:47:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=morth-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=TeyHhAnGuSIf240LEOkWUNOOvv9CPFy4yhUwGRcs+a8=; b=QzHZuaiUs7jQMtpJu4kdsgurYHoVDbd/KxucNZLCFrFk+c65UPxv3gKF+6PFbmrAsH PmPgsO5q9sgAnNc3iwZOAFrEh3keWQC+Mb8CkNqFLhAPLSugxqrNJLrs6jEWs7LrRAmA s9CjIg4hbs5RCJp1t7HJng2W1tHV6C7GPz4HcLxf6wTICozHHzPVk6mKTmlYdqFqhu1G yiMVqAkPIjNoVO5/apPGjcaoZR7ej9w9sfq/e8IM1a47qohnOqggF3nXaEJTVdSx0Rus +c0YKzZy3dbZj054qXhXRjhl92604xqVwUm6+LWC5K5+xIVgxjcNEZY4Ui0Mwwf3b6bF F8gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=TeyHhAnGuSIf240LEOkWUNOOvv9CPFy4yhUwGRcs+a8=; b=GGN6FaxbMtyGW2wleT9FrXgfuTLlX/djuokRlYM4HqWk5HySnx67rBt5wGPDh/3Zpd /KYS2nljQhQKLzkIDIxk/c+p7k2ZfVPQ8MCoE2KGLlBKiCDKFx39f1jDCQT1rRad1+qX QexWAI2Z76kBkmgPqceDIj46D14Pp3QPOfMTdGUiSzfkvUzkHgaKgv5v3QzmnJ8F3Fg0 hY+SlV5gnueS/XiudbXMqOpfLUkumo4ZvgtmCB4bQJz0OJanq3yoQfVqQzsiO57WPKzl y9mf0OsTu6fthZnKEaA54Sv/lkqdfx7kh3GvY4prQAamfnKVReLSl4ijGsB+FRhae3jM VJdw== X-Gm-Message-State: AEkooutnI41fbPp6qW+edsR5E8AUpepUkD2JeBjPdt05ErchoIxtXXXKO3OG8rYChcSRxupzHVDS1z4lLLjbMA== X-Received: by 10.31.64.196 with SMTP id n187mr4046741vka.150.1472111226684; Thu, 25 Aug 2016 00:47:06 -0700 (PDT) Original-Sender: pelle@morth.org X-Google-Sender-Auth: 1b8R79btv_5FcKCVUQZgOPVNHIU Xref: news.gmane.org gmane.linux.lib.musl.general:10395 Archived-At: Hello, I'm trying to port a code base to musl. I've run into an issue with prioritynames as defined by syslog.h: CODE *pri_code = prioritynames; produces error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] This is repeated once per element in the array. While the error message points to -Wdiscarded-qualifiers I believe this is actually due to us using -Wwrite-strings which turns string literals into type const char* instead of char*. I suppose the most compatible solution would be to cast each string literal to char* in the define. It's either that or use const char* in the struct, but that's likely to cause issues in other programs. Or use some trickery to disable the warning I suppose, wouldn't know about that. Please CC me on any reply as I'm currently not subscribed. Minimal code to reproduce: #define SYSLOG_NAMES #include CODE *c = prioritynames; Compiles without warning: gcc -nostdinc -isystem include -isystem obj/include -c test.c Adding -Wwrite-strings give warnings: gcc -Wwrite-strings -nostdinc -isystem include -isystem obj/include -c test.c Regards, -- Per Johansson