Send MinGW-Notify mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.osdn.me/mailman/listinfo/mingw-notify
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-Notify digest..."
Please do not reply to this notification; the sender address is unable to
accept incoming e-mail. If you wish to unsubscribe you can do so at
https://lists.osdn.me/mailman/listinfo/mingw-notify.
Today's Topics:
1. [mingw] #43663: %zd and %td support in attribute format
printf (MinGW Notification List)
2. [mingw] #42768: mingw.org domain hijacked
(MinGW Notification List)
----------------------------------------------------------------------
Message: 1
Date: Mon, 24 Jan 2022 15:19:36 +0000
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #43663: %zd and %td support in
attribute format printf
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
#43663: %zd and %td support in attribute format printf
Open Date: 2022-01-20 10:09
Last Update: 2022-01-24 15:19
URL for this Ticket:
https://osdn.net//projects/mingw/ticket/43663
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=43663
---------------------------------------------------------------------
Last Changes/Comment on this Ticket:
2022-01-24 15:19 Updated by: keith
* Status Update from Open to Closed
* Resolution Update from None to Works For Me
Comment:
A review of the relevant section of the GCC manual should provide enlightenment
... search for the "format" attribute sub-heading. I kind of suspected that we
might arrive at this conclusion: the behaviour here is exactly as documented,
so there is no bug to address, (other than user error).
The GCC documentation is rather terse, so some further explanation may be
helpful. If we review your original test case (with line numbers inserted):
#include <stddef.h> int foo(const char*,...) __attribute__((format(printf, 1,
2))); int main(void) { size_t f = sizeof(size_t); return
foo("%zd\n", f); }This should compile fine, (probably) with any target variant
of GCC except a MinGW variant. See, a MinGW target GCC implements (at least)
two distinct flavours of the "printf" category for the "format" attribute,
namely "gnu_printf" and "ms_printf" — whereas most targets comprehend only
"gnu_printf" — and for the MinGW target, "printf" is interpreted as
"ms_printf". Thus, your test case effectively becomes:
#include <stddef.h> int foo(const char*,...) __attribute__((format(ms_printf,
1, 2))); int main(void) { size_t f = sizeof(size_t); return
foo("%zd\n", f); }and this leads to a -Wformat anomaly at line 7, because "%zd"
is not a valid format specification, within the "ms_printf" category, as
specified at line 2. If your function "foo()" interprets format specifications
according to "gnu_printf" rules, then you need to specify that explicitly:
#include <stddef.h> int foo(const char*,...) __attribute__((format(gnu_printf,
1, 2))); int main(void) { size_t f = sizeof(size_t); return
foo("%zd\n", f); }FWIW, our MinGW.OSDN builds of GCC, from GCC-6.3.0 onwards,
implement a third category of "printf" Wformat checks, namely "mingw_printf";
(other distributions may not support this). Used thus:
#include <stddef.h> int foo(const char*,...)
__attribute__((format(mingw_printf, 1, 2))); int main(void) { size_t f
= sizeof(size_t); return foo("%zd\n", f); }this creates a hybrid of
both "ms_printf" and "gnu_printf", (with any conflicts resolved in favour of
the "gnu_printf" interpretation), and provides correct -Wformat checking for
the "printf()" family replacement functions, which we provide in our
libmingwex.a, and libmingwex-4.dll libraries.
With either "gnu_printf", or "mingw_printf" specified as the format attribute
category, in line 2 of your test case, compilation succeeds without warnings:
$ mingw32-gcc -Wall -fsyntax-only a.c
$
Consequently, I am closing this ticket, with no further action required.
---------------------------------------------------------------------
Ticket Status:
Reporter: eric_pouech
Owner: (None)
Type: Issues
Status: Closed
Priority: 5 - Medium
MileStone: (None)
Component: (None)
Severity: 5 - Medium
Resolution: Works For Me
---------------------------------------------------------------------
Ticket details:
sample a.c
#include <stddef.h>
int foo(const char*,...) __attribute__((format(printf, 1, 2)));
int main(void)
{
size_t f = sizeof(size_t);
return foo("%zd\n", f);
}
this simple program, compiled with -Wall warns about unsupported %zd
$ x86_64-w64-mingw32-gcc a.c -Wall
a.c: In function 'main':
a.c:7:22: warning: unknown conversion type character 'z' in format [-Wformat=]
7 | return foo("%zd\n", f);
| ^
$ i686-w64-mingw32-gcc a.c -Wall
a.c: In function 'main':
a.c:7:22: warning: unknown conversion type character 'z' in format [-Wformat=]
7 | return foo("%zd\n", f);
| ^
whereas gcc compiles the snipnet just fine
version info$ x86_64-w64-mingw32-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/x86_64-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-w64-mingw32/11.2.1/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/usr --bindir=/usr/bin
--includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info
--datadir=/usr/share --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --with-gnu-as --with-gnu-ld --verbose
--without-newlib --disable-multilib --disable-plugin --with-system-zlib
--disable-nls --without-included-gettext --disable-win32-registry
--enable-languages=c,c++,objc,obj-c++,fortran
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-threads=posix
--with-isl --enable-libgomp --target=x86_64-w64-mingw32
--with-sysroot=/usr/x86_64-w64-mingw32/sys-root
--with-gxx-include-dir=/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20210728 (Fedora MinGW 11.2.1-3.fc35) (GCC)
version info$ i686-w64-mingw32-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/i686-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-w64-mingw32/11.2.1/lto-wrapper
Target: i686-w64-mingw32
Configured with: ../configure --prefix=/usr --bindir=/usr/bin
--includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info
--datadir=/usr/share --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --with-gnu-as --with-gnu-ld --verbose
--without-newlib --disable-multilib --disable-plugin --with-system-zlib
--disable-nls --without-included-gettext --disable-win32-registry
--enable-languages=c,c++,objc,obj-c++,fortran
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-threads=posix
--with-isl --enable-libgomp --target=i686-w64-mingw32
--with-sysroot=/usr/i686-w64-mingw32/sys-root
--with-gxx-include-dir=/usr/i686-w64-mingw32/sys-root/mingw/include/c++
--disable-sjlj-exceptions --with-dwarf2
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20210728 (Fedora MinGW 11.2.1-3.fc35) (GCC)
MS compiler supports %zd as the preferred way to print size_t values
(didn't included in the tests, but %td for ptrdiff_t suffers from the same
issues)
--
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN
Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net
URL for this Ticket:
https://osdn.net/projects/mingw/ticket/43663
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=43663
------------------------------
Message: 2
Date: Mon, 24 Jan 2022 20:27:01 +0000
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #42768: mingw.org domain hijacked
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
#42768: mingw.org domain hijacked
Open Date: 2021-08-25 10:42
Last Update: 2022-01-24 20:27
URL for this Ticket:
https://osdn.net//projects/mingw/ticket/42768
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=42768
---------------------------------------------------------------------
Last Changes/Comment on this Ticket:
2022-01-24 20:27 Updated by: keith
* Status Update from Open to Closed
* Resolution Update from None to Won't Fix
Comment:
We no longer own the mingw.org domain. When NetworkRedux.com moved out of the
web hosting market, and withdrew our sponsorship, eNom.com blocked our
legitimate attempts to transfer the registration to a new sponsor, and
attempted to hold us to ransom. We declined to be blackmailed, and eNom.com
have sold the domain — illegally, because we still own the MinGW trademark, so
the new owner is infringing that.
Regardless, our official web-site may now be found at https://mingw.osdn.io
---------------------------------------------------------------------
Ticket Status:
Reporter: jimbo19692
Owner: (None)
Type: Issues
Status: Closed
Priority: 5 - Medium
MileStone: (None)
Component: WEBSITE
Severity: 5 - Medium
Resolution: Won't Fix
---------------------------------------------------------------------
Ticket details:
Likely only the DNS settings have been hijacked. When navigating to mingw.org,
you end up on a page with obvious malware (Chrome extension in at least one
case, but it rotates) being served (i.e. attempts to fool unsuspecting users
into downloading & installing rogue software). It is not just an add contained
within the page -- it is the whole page. There is either an A RECORD in the
DNS, or a forward/redirect on the real mingw site that has been hijacked to
send folks to the malicious site instead.
I think this, at the very least, undermines trust and confidence in the MinGW
product. To add insult to injury, eventually, after rejecting the fake
downloads enough, the page (on one occasion, at least) redirected to the
mingw-w64 site. There seems to be some logic built into the redirect, based on
the referrer, leading me to suspect a forward/redirect on the real page, rather
than a DNS issue.
Good luck with it, and with your impressive MinGW tool.
Sincerely,
--James Wing
--
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN
Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net
URL for this Ticket:
https://osdn.net/projects/mingw/ticket/42768
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=42768
------------------------------
Subject: Digest Footer
_______________________________________________
MinGW-Notify mailing list
[email protected]
https://lists.osdn.me/mailman/listinfo/mingw-notify
------------------------------
End of MinGW-Notify Digest, Vol 49, Issue 4
*******************************************