You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Travis Vitek (JIRA)" <ji...@apache.org> on 2008/06/12 20:12:45 UTC
[jira] Created: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
[HP aCC 6.16] Remark #4231 using std::vector<>::assign
------------------------------------------------------
Key: STDCXX-968
URL: https://issues.apache.org/jira/browse/STDCXX-968
Project: C++ Standard Library
Issue Type: Improvement
Affects Versions: 4.2.1
Reporter: Travis Vitek
Priority: Trivial
Fix For: 4.2.2
Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
{noformat}
[vitek@gofish tests]$ cat t.cpp && gmake t.o
#include <vector>
struct S { };
int main ()
{
S s;
std::vector<S> v;
v.assign (&s, &s + 1);
return 0;
}
aCC -c -D_RWSTDDEBUG \
-I/amd/devco/vitek/stdcxx/4.3.x/include \
-I/build/vitek/4.3.0/11S/include \
-I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
-AA -g +d +DD64 +w \
+W392,655,684,818,819,849 \
+W2193,2236,2261,2340,2401,2487 \
+W4227,4229,4235,4237,4249 \
+W4255,4272,4284,4285,4286,4296,4297 \
+W3348 t.cpp
"/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
bit migration: conversion between types of different sizes has
occurred (from "int" to "void *" )
_C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
^
detected during instantiation of "void std::vector<_TypeT,
_Allocator>::assign(_InputIter, _InputIter) [with
_TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
at line 10 of "t.cpp"
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor updated STDCXX-968:
--------------------------------
Component/s: 23. Containers
Description:
Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
{noformat}
[vitek@gofish tests]$ cat t.cpp && gmake t.o
#include <vector>
struct S { };
int main ()
{
S s;
std::vector<S> v;
v.assign (&s, &s + 1);
return 0;
}
aCC -c -D_RWSTDDEBUG \
-I/amd/devco/vitek/stdcxx/4.3.x/include \
-I/build/vitek/4.3.0/11S/include \
-I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
-AA -g +d +DD64 +w \
+W392,655,684,818,819,849 \
+W2193,2236,2261,2340,2401,2487 \
+W4227,4229,4235,4237,4249 \
+W4255,4272,4284,4285,4286,4296,4297 \
+W3348 t.cpp
"/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
bit migration: conversion between types of different sizes has
occurred (from "int" to "void *" )
_C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
^
detected during instantiation of "void std::vector<_TypeT,
_Allocator>::assign(_InputIter, _InputIter) [with
_TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
at line 10 of "t.cpp"
{noformat}
was:
Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
{noformat}
[vitek@gofish tests]$ cat t.cpp && gmake t.o
#include <vector>
struct S { };
int main ()
{
S s;
std::vector<S> v;
v.assign (&s, &s + 1);
return 0;
}
aCC -c -D_RWSTDDEBUG \
-I/amd/devco/vitek/stdcxx/4.3.x/include \
-I/build/vitek/4.3.0/11S/include \
-I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
-AA -g +d +DD64 +w \
+W392,655,684,818,819,849 \
+W2193,2236,2261,2340,2401,2487 \
+W4227,4229,4235,4237,4249 \
+W4255,4272,4284,4285,4286,4296,4297 \
+W3348 t.cpp
"/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
bit migration: conversion between types of different sizes has
occurred (from "int" to "void *" )
_C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
^
detected during instantiation of "void std::vector<_TypeT,
_Allocator>::assign(_InputIter, _InputIter) [with
_TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
at line 10 of "t.cpp"
{noformat}
Assignee: Travis Vitek
Set Component to Containers and assigned to reporter.
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek resolved STDCXX-968.
---------------------------------
Resolution: Fixed
Committed to 4.2.x in [r682771|http://svn.apache.org/viewvc?rev=682771]
Merged to 4.3.x in [r682772|http://svn.apache.org/viewvc?rev=682772]
Merged to trunk in [r682773|http://svn.apache.org/viewvc?rev=682773]
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647392#action_12647392 ]
Farid Zaripov commented on STDCXX-968:
--------------------------------------
Martin, look at the STDCXX-1009 issue. Using 0 in _RWSTD_DISPATCH causes the ambiguity.
And secondly, the #4231 warning is disabled in etc/config/acc.config. Travis enabled this warning manually (look at the first line of the issue description).
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor closed STDCXX-968.
-------------------------------
Looks like the fix did it. I don't see any remark #4231 in our aCC 6 12D builds anymore.
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646932#action_12646932 ]
Martin Sebor commented on STDCXX-968:
-------------------------------------
The 0 looks fine to me. I had at first thought the 1 was there on purpose, to get around some compiler's bug, but going back in the changelog (pre-2005) I don't see an explanation for it. The original code had a 0 there and was changed to 1 without a hint as to why.
{noformat}
#define _RWSTD_DISPATCH(iter) \
((_RW::__rw_select<_RW::__rw_is_int< iter >::_C_val>*)0)
{noformat}
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629555#action_12629555 ]
Farid Zaripov commented on STDCXX-968:
--------------------------------------
How about replacing 1 with 1L as alternative solution?
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Components: 23. Containers
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Assignee: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-968) [HP aCC 6.16] Remark #4231 using
std::vector<>::assign
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604599#action_12604599 ]
Travis Vitek commented on STDCXX-968:
-------------------------------------
The fix is to modify the {{_RWSTD_DISPATCH}} macro in {{_select.h}} as follows
{noformat}
# define _RWSTD_DISPATCH(iter) \
- (_TYPENAME _RW::__rw_select_int< iter >::_SelectT (1))
+ (_TYPENAME _RW::__rw_select_int< iter >::_SelectT (0))
{noformat}
The macro essentially expands out to {{void* = 1}} or {{int = 1}}, and the modified version substitutes a 0 for the 1. This is better because 0 is the special NULL pointer value.
> [HP aCC 6.16] Remark #4231 using std::vector<>::assign
> ------------------------------------------------------
>
> Key: STDCXX-968
> URL: https://issues.apache.org/jira/browse/STDCXX-968
> Project: C++ Standard Library
> Issue Type: Improvement
> Affects Versions: 4.2.1
> Reporter: Travis Vitek
> Priority: Trivial
> Fix For: 4.2.2
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Note that I have removed +W4231 from the build line by modifying {{$(BUILDDIR)/makefile.in}}
> {noformat}
> [vitek@gofish tests]$ cat t.cpp && gmake t.o
> #include <vector>
> struct S { };
> int main ()
> {
> S s;
> std::vector<S> v;
> v.assign (&s, &s + 1);
> return 0;
> }
> aCC -c -D_RWSTDDEBUG \
> -I/amd/devco/vitek/stdcxx/4.3.x/include \
> -I/build/vitek/4.3.0/11S/include \
> -I/amd/devco/vitek/stdcxx/4.3.x/tests/include \
> -AA -g +d +DD64 +w \
> +W392,655,684,818,819,849 \
> +W2193,2236,2261,2340,2401,2487 \
> +W4227,4229,4235,4237,4249 \
> +W4255,4272,4284,4285,4286,4296,4297 \
> +W3348 t.cpp
> "/amd/devco/vitek/stdcxx/4.3.x/include/vector", line 194: remark #4231-D: 64
> bit migration: conversion between types of different sizes has
> occurred (from "int" to "void *" )
> _C_assign (__first, __last, _RWSTD_DISPATCH (_InputIter));
> ^
> detected during instantiation of "void std::vector<_TypeT,
> _Allocator>::assign(_InputIter, _InputIter) [with
> _TypeT=S, _Allocator=std::allocator<S>, _InputIter=S *]"
> at line 10 of "t.cpp"
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.