Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLib] dangling-gsl warning with GLib 2.76.0 #34621

Closed
kou opened this issue Mar 17, 2023 · 0 comments · Fixed by #34624
Closed

[GLib] dangling-gsl warning with GLib 2.76.0 #34621

kou opened this issue Mar 17, 2023 · 0 comments · Fixed by #34624

Comments

@kou
Copy link
Member

kou commented Mar 17, 2023

Describe the bug, including details regarding any error messages, version, and platform.

https://github.com/apache/arrow/actions/runs/4445709965/jobs/7805154277?pr=34601#step:9:128

FAILED: arrow-glib/libarrow-glib.1200.dylib.p/basic-data-type.cpp.o 
ccache c++ -Iarrow-glib/libarrow-glib.1200.dylib.p -Iarrow-glib -I../../c_glib/arrow-glib -I. -I../../c_glib -I/usr/local/include -I/usr/local/Cellar/glib/2.76.0/include -I/usr/local/Cellar/glib/2.76.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.76.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.42/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -fcolor-diagnostics -Wall -Winvalid-pch -Werror -std=c++17 -O0 -g -Wmissing-declarations -DARROW_NO_DEPRECATED_API -MD -MQ arrow-glib/libarrow-glib.1200.dylib.p/basic-data-type.cpp.o -MF arrow-glib/libarrow-glib.1200.dylib.p/basic-data-type.cpp.o.d -o arrow-glib/libarrow-glib.1200.dylib.p/basic-data-type.cpp.o -c ../../c_glib/arrow-glib/basic-data-type.cpp
../../c_glib/arrow-glib/basic-data-type.cpp:300:19: error: object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl]
  return g_strdup(arrow_data_type->ToString().c_str());
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/glib/2.76.0/include/glib-2.0/glib/gstrfuncs.h:211:38: note: expanded from macro 'g_strdup'
        const char *const ___str = ((STR));                                   \
                                     ^~~
../../c_glib/arrow-glib/basic-data-type.cpp:300:10: error: object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl]
  return g_strdup(arrow_data_type->ToString().c_str());
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/glib/2.76.0/include/glib-2.0/glib/gstrfuncs.h:212:51: note: expanded from macro 'g_strdup'
        const char *const __str = _G_STR_NONNULL (___str);                    \
                                                  ^~~~~~
/usr/local/Cellar/glib/2.76.0/include/glib-2.0/glib/gstrfuncs.h:157:29: note: expanded from macro '_G_STR_NONNULL'
#define _G_STR_NONNULL(x) ((x) + !(x))
                            ^

Component(s)

GLib

@kou kou added the Type: bug label Mar 17, 2023
kou added a commit to kou/arrow that referenced this issue Mar 17, 2023
Because it reports "object backing the pointer will be destroyed at
the end of the full-expression" [-Wdangling-gsl] warning.
kou added a commit to kou/arrow that referenced this issue Mar 17, 2023
Because it reports "object backing the pointer will be destroyed at
the end of the full-expression" [-Wdangling-gsl] warning.
kou added a commit to kou/arrow that referenced this issue Mar 17, 2023
Because it reports "object backing the pointer will be destroyed at
the end of the full-expression" [-Wdangling-gsl] warning.
kou added a commit that referenced this issue Mar 17, 2023
### Rationale for this change

Because it reports "object backing the pointer will be destroyed at the end of the full-expression" [-Wdangling-gsl] warning.

### What changes are included in this PR?

Create a variable for temporary `std::string`. 

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #34621

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 12.0.0 milestone Mar 17, 2023
rtpsw pushed a commit to rtpsw/arrow that referenced this issue Mar 27, 2023
…pache#34624)

### Rationale for this change

Because it reports "object backing the pointer will be destroyed at the end of the full-expression" [-Wdangling-gsl] warning.

### What changes are included in this PR?

Create a variable for temporary `std::string`. 

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#34621

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant