All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Martin <s.martin49@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/3] package/urg: fix build with gcc-6
Date: Mon, 12 Sep 2016 21:23:23 +0200	[thread overview]
Message-ID: <20160912192324.23682-2-s.martin49@gmail.com> (raw)
In-Reply-To: <20160912192324.23682-1-s.martin49@gmail.com>

Add patch fixing/adding explicit cast on negative value in char[], which
is required with gcc-6 (see "Narrowing conversions" paragraph in [1])

Fixes:
  http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/

[1] https://gcc.gnu.org/gcc-6/porting_to.html

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 .../0002-urg-gcc6-fix-narrowing-conversion.patch   | 99 ++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch

diff --git a/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch b/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch
new file mode 100644
index 0000000..e3db898
--- /dev/null
+++ b/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch
@@ -0,0 +1,99 @@
+urg: fix 'narrowing conversion' with gcc6
+
+Fixes:
+  http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+
+--- a/src/cpp/urg/ScipHandler.cpp	2016-09-11 16:11:16.083995214 +0200
++++ b/src/cpp/urg/ScipHandler.cpp	2016-09-11 16:11:24.380832543 +0200
+@@ -120,7 +120,7 @@ struct ScipHandler::pImpl
+ 
+       // QT ?????s
+       int return_code = -1;
+-      char qt_expected_response[] = { 0, -1 };
++      char qt_expected_response[] = { 0, (char)-1 };
+       // return_code ???g???????????AsetLaserOutput() ???p?????? QT ?????M????
+       if (response(return_code, "QT\n", qt_expected_response)) {
+         laser_state_ = LaserOff;
+@@ -139,7 +139,7 @@ struct ScipHandler::pImpl
+ 
+       } else if (return_code == Scip11Response) {
+         // SCIP1.1 ?v???g?R?????????????ASCIP2.0 ?????M????
+-        char scip20_expected_response[] = { 0, -1 };
++        char scip20_expected_response[] = { 0, (char)-1 };
+         if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) {
+           error_message_ =
+             "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting.";
+@@ -150,7 +150,7 @@ struct ScipHandler::pImpl
+ 
+       } else if (return_code == 0xE) {
+         // TM ???[?h?????????ATM2 ?????s????
+-        char tm2_expected_response[] = { 0, -1 };
++        char tm2_expected_response[] = { 0, (char)-1 };
+         if (response(return_code, "TM2\n", tm2_expected_response)) {
+           laser_state_ = LaserOff;
+           return changeBothBaudrate(baudrate);
+@@ -202,7 +202,7 @@ struct ScipHandler::pImpl
+     snprintf(send_buffer, 10, "SS%06ld\n", baudrate);
+     int return_code = -1;
+     // !!! ???????????????{?[???[?g?A?????????????l?? ss_expected... ??????????
+-    char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 };
++    char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 };
+     if (! response(return_code, send_buffer, ss_expected_response)) {
+       error_message_ = "Baudrate change fail.";
+       return false;
+@@ -216,7 +216,7 @@ struct ScipHandler::pImpl
+   {
+     // PP ?????M???f?[?^?????M
+     int return_code = -1;
+-    char pp_expected_response[] = { 0, -1 };
++    char pp_expected_response[] = { 0, (char)-1 };
+     vector<string> lines;
+     if (! response(return_code, "PP\n", pp_expected_response, &lines)) {
+       error_message_ = "PP fail.";
+@@ -356,7 +356,7 @@ struct ScipHandler::pImpl
+ 
+     if (on) {
+       int return_code = -1;
+-      char expected_response[] = { 0, -1 };
++      char expected_response[] = { 0, (char)-1 };
+       if (! response(return_code, "BM\n", expected_response)) {
+         error_message_ = "BM fail.";
+         return false;
+@@ -369,7 +369,7 @@ struct ScipHandler::pImpl
+       if (! mx_capturing_) {
+         // ?????????????? QT ?????A??????????????
+         int return_code = -1;
+-        char qt_expected_response[] = { 0, -1 };
++        char qt_expected_response[] = { 0, (char)-1 };
+         if (! response(return_code, "QT\n", qt_expected_response)) {
+           return false;
+         }
+@@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen
+ bool ScipHandler::versionLines(vector<string>& lines)
+ {
+   int return_code = -1;
+-  char expected_response[] = { 0, -1 };
++  char expected_response[] = { 0, (char)-1 };
+   if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) {
+     return false;
+   }
+@@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo
+ 
+   // TM0 or TM2 ?????M
+   int return_code = -1;
+-  char expected_response[] = { 0, -1 };
++  char expected_response[] = { 0, (char)-1 };
+   if (! pimpl->response(return_code, send_command, expected_response)) {
+     pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail.";
+     return false;
+@@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time
+ {
+   // TM1 ???l??????
+   int return_code = -1;
+-  char expected_response[] = { 0, -1 };
++  char expected_response[] = { 0, (char)-1 };
+   vector<string> lines;
+   if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) {
+     pimpl->error_message_ = "TM1 fail.";
-- 
2.9.3

  reply	other threads:[~2016-09-12 19:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 19:23 [Buildroot] [PATCH 1/3] package/urg: fix build Samuel Martin
2016-09-12 19:23 ` Samuel Martin [this message]
2016-09-12 20:41   ` [Buildroot] [PATCH 2/3] package/urg: fix build with gcc-6 Thomas Petazzoni
2016-09-13  4:19     ` Samuel Martin
2016-09-13  6:38       ` Arnout Vandecappelle
2016-10-15 10:24   ` Thomas Petazzoni
2016-09-12 19:23 ` [Buildroot] [PATCH 3/3] package/nginx-naxsi: add missing pcre dependency Samuel Martin
2016-09-12 20:39   ` Thomas Petazzoni
2016-09-13  6:40   ` Arnout Vandecappelle
2016-09-13  7:57     ` Samuel Martin
2016-09-13 17:30       ` Arnout Vandecappelle
2016-09-13 17:52         ` Samuel Martin
2016-09-14 11:45         ` Thomas Petazzoni
2016-09-12 20:41 ` [Buildroot] [PATCH 1/3] package/urg: fix build Thomas Petazzoni
2016-09-14  9:47   ` Thomas Petazzoni
2016-09-15  4:37     ` Samuel Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160912192324.23682-2-s.martin49@gmail.com \
    --to=s.martin49@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.