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

Cygwin: Warning: assignment discards 'const' qualifier (S_copy_little_tm_to_big_TM) #15391

Closed
p5pRT opened this issue Jun 10, 2016 · 6 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Jun 10, 2016

Migrated from rt.perl.org#128359 (status was 'resolved')

Searchable as RT128359$

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2016

From @dcollinsn

My system struct tm is defined thusly​:

  struct tm
  {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
  #ifdef __TM_GMTOFF
  long __TM_GMTOFF;
  #endif
  #ifdef __TM_ZONE
  const char *__TM_ZONE;
  #endif
  };

When compiling with the default flags, I receive the following warning​:

cc -c -DPERL_CORE -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -std=c89 -O3 -g -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings time64.c
time64.c​: In function ‘S_copy_little_tm_to_big_TM’​:
time64.c​:284​:25​: warning​: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  dest->tm_zone = src->tm_zone;
  ^

Adding __CYGWIN__ to the list of platforms where we have const char* tm_zone in time64.h silences the warning, however it might be better to detect this automatically in Configure.

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2016

From @tonycoz

On Thu Jun 09 17​:23​:02 2016, dcollinsn@​gmail.com wrote​:

Adding __CYGWIN__ to the list of platforms where we have const char*
tm_zone in time64.h silences the warning, however it might be better
to detect this automatically in Configure.

Thanks, fixed in 143048c.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2016

@tonycoz - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.26.0, this and 210 other issues have been
resolved.

Perl 5.26.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.26.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant