Bug 45998 - libgfortran/io/write.c: warning: discards 'const' qualifier from pointer target
Summary: libgfortran/io/write.c: warning: discards 'const' qualifier from pointer target
Status: RESOLVED DUPLICATE of bug 41219
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-13 07:50 UTC by Tobias Burnus
Modified: 2010-10-14 01:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2010-10-13 07:50:55 UTC
Reported for MinGW64 in #gfortran:

< NightStrike_> ../../../../../build/gcc/src/libgfortran/io/write.c:394:8: warning: passing argument 2 of 'write_default_char4' discards 'const' qualifier from pointer target type [enabled by default]

That's the line
              write_default_char4 (dtp, crlf, 2, 0);
where
      const gfc_char4_t crlf[] = {0x000d,0x000a};
and
write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
                     int src_len, int w_len)

I wonder whether one shouldn't simply make the second parameter of write_default_char4 "const".
Comment 1 Ozkan Sezer 2010-10-13 08:05:22 UTC
Already reported in PR41219 for 4.5.x.
Comment 2 Jerry DeLisle 2010-10-14 01:29:41 UTC
I missed the PR noted above for some reason.  I will take care of it.  I am running into similar warnings while working other patches. I will mark this duplicate and assign myself to the other.

*** This bug has been marked as a duplicate of bug 41219 ***