Bug#997248: mysql++: FTBFS: ./examples/load_jpeg.cpp:90:50: error: taking address of rvalue [-fpermissive]

2021-11-22 Thread Sascha Steinbiss
Hi Roberto,

thanks for the quick response!

> I cannot attend to this at the moment, so I give you my blessing to
> proceed with the NMU.

Thanks, will do that and upload soon.

Cheers
Sascha



Bug#997248: mysql++: FTBFS: ./examples/load_jpeg.cpp:90:50: error: taking address of rvalue [-fpermissive]

2021-11-22 Thread Roberto C . Sánchez
On Mon, Nov 22, 2021 at 01:16:06PM +0100, Sascha Steinbiss wrote:
> Hi everyone,
> 
> looks like upstream fixed this already [0]. The fix is easily imported
> into packaging, see attached debdiff.
> 
> I would be happy to NMU this within a week or so if there is no action
> by the maintainer to avoid mysql++ to be removed from testing. Please
> let me know if this is not wanted. Also addressing this mail to the
> previous uploader of the package.
> 
> mysql++ is a dependency of my augustus package, which I would prefer not
> to be removed from testing.
> 
Hi Sascha,

I cannot attend to this at the moment, so I give you my blessing to
proceed with the NMU.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com



Bug#997248: mysql++: FTBFS: ./examples/load_jpeg.cpp:90:50: error: taking address of rvalue [-fpermissive]

2021-11-22 Thread Sascha Steinbiss
Hi everyone,

looks like upstream fixed this already [0]. The fix is easily imported
into packaging, see attached debdiff.

I would be happy to NMU this within a week or so if there is no action
by the maintainer to avoid mysql++ to be removed from testing. Please
let me know if this is not wanted. Also addressing this mail to the
previous uploader of the package.

mysql++ is a dependency of my augustus package, which I would prefer not
to be removed from testing.


Thanks
Sascha

[0]
https://github.com/tangentsoft/mysqlpp/commit/df890798c8017dee79d5e4ee0867e2dae44ca5b5
diff -Nru mysql++-3.2.5/debian/changelog mysql++-3.2.5/debian/changelog
--- mysql++-3.2.5/debian/changelog	2020-04-23 03:37:47.0 +0200
+++ mysql++-3.2.5/debian/changelog	2021-11-22 13:01:43.0 +0100
@@ -1,3 +1,11 @@
+mysql++ (3.2.5-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Incorporate patch from upstream to fix build on newer GCC versions.
+(Closes: #997248)
+
+ -- Sascha Steinbiss   Mon, 22 Nov 2021 13:01:43 +0100
+
 mysql++ (3.2.5-2) unstable; urgency=medium
 
   * Update to Standards-Version 4.5.0 (no changes)
diff -Nru mysql++-3.2.5/debian/patches/rvalue_fix_example.patch mysql++-3.2.5/debian/patches/rvalue_fix_example.patch
--- mysql++-3.2.5/debian/patches/rvalue_fix_example.patch	1970-01-01 01:00:00.0 +0100
+++ mysql++-3.2.5/debian/patches/rvalue_fix_example.patch	2021-11-22 12:55:30.0 +0100
@@ -0,0 +1,57 @@
+From df890798c8017dee79d5e4ee0867e2dae44ca5b5 Mon Sep 17 00:00:00 2001
+From: tangent 
+Date: Sat, 19 Sep 2020 17:24:45 +
+Subject: [PATCH] Exchanged the "file slurp" idiom used in
+ examples/load_jpeg.cpp for one that also works in C++11, which complains of
+ "address to rvalue" with the original formulation.
+
+FossilOrigin-Name: b062e656cc2ed9356c6f757837580a2145251c5294e382f8e2c1ad3e74a91cdd
+---
+ examples/load_jpeg.cpp | 18 ++
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+--- a/examples/load_jpeg.cpp
 b/examples/load_jpeg.cpp
+@@ -2,9 +2,9 @@
+  load_jpeg.cpp - Example showing how to insert BLOB data into the
+ 	database from a file.
+ 
+- Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
+- (c) 2004-2009 by Educational Technology Resources, Inc.  Others may
+- also hold copyrights on code in this file.  See the CREDITS.txt file
++ Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and
++ © 2004-2009 by Educational Technology Resources, Inc.  Others may
++ also hold copyrights on code in this file.  See the CREDITS.md file
+  in the top directory of the distribution for details.
+ 
+  This file is part of MySQL++.
+@@ -80,14 +80,16 @@
+ 	img_name = cmdline.extra_args()[0];
+ 	ifstream img_file(img_name.c_str(), ios::binary);
+ 	if (img_file) {
+-		// Slurp file contents into RAM with minimum copying.  (Idiom
+-		// explained here: http://stackoverflow.com/questions/116038/)
++		// Slurp file contents into RAM with only a single copy, per
++		// https://stackoverflow.com/a/116220  It also explains why
++// there is no concise zero-copy option here.
+ 		//
+ 		// By loading the file into a C++ string (stringstream::str())
+ 		// and assigning that directly to a mysqlpp::sql_blob, we avoid
+ 		// truncating the binary data at the first null character.
+-		img.data.data = static_cast(
+-&(stringstream() << img_file.rdbuf()))->str();
++stringstream ss;
++ss << img_file.rdbuf();
++		img.data.data = ss.str();
+ 
+ 		// Check JPEG data for sanity.
+ 		const char* error;
+@@ -130,7 +132,7 @@
+ 			// as C strings, thus causing null-truncation.  The fact
+ 			// that we're using SSQLS here is a side issue, simply
+ 			// demonstrating that mysqlpp::Null is
+-			// now legal in SSQLS, as of MySQL++ 3.0.7.
++// now legal in SSQLS, as of MySQL++ 3.0.7.
+ 			Query query = con.query();
+ 			query.insert(img);
+ 			SimpleResult res = query.execute();
diff -Nru mysql++-3.2.5/debian/patches/series mysql++-3.2.5/debian/patches/series
--- mysql++-3.2.5/debian/patches/series	2020-04-23 03:37:47.0 +0200
+++ mysql++-3.2.5/debian/patches/series	2021-11-22 12:54:57.0 +0100
@@ -1,2 +1,3 @@
 do_not_link_against_libmysqlclient_r.patch
 discover_localtime_r_with_AC_TRY_COMPILE.patch
+rvalue_fix_example.patch


Bug#997248: mysql++: FTBFS: ./examples/load_jpeg.cpp:90:50: error: taking address of rvalue [-fpermissive]

2021-10-23 Thread Lucas Nussbaum
Source: mysql++
Version: 3.2.5-2
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> g++ -c -o resetdb_resetdb.o -Ilib -I/usr/include/mysql  -Wdate-time 
> -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<>=. 
> -fstack-protector-strong -Wformat -Werror=format-security 
> ./examples/resetdb.cpp
> ./examples/load_jpeg.cpp: In function ‘bool load_jpeg_file(const 
> mysqlpp::examples::CommandLine&, images&, std::string&)’:
> ./examples/load_jpeg.cpp:90:50: error: taking address of rvalue [-fpermissive]
>90 | &(stringstream() << 
> img_file.rdbuf()))->str();
>   |  ^~~~
> g++ -c -o simple1_simple1.o -Ilib -I/usr/include/mysql  -Wdate-time 
> -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<>=. 
> -fstack-protector-strong -Wformat -Werror=format-security 
> ./examples/simple1.cpp
> make[1]: *** [Makefile:794: load_jpeg_load_jpeg.o] Error 1


The full build log is available from:
http://qa-logs.debian.net/2021/10/23/mysql++_3.2.5-2_unstable.log

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.