Skip to content

Conversation

jkeenan
Copy link
Contributor

@jkeenan jkeenan commented Jan 30, 2022

For: #19382

inline.h Outdated
else
return NULL;
{
const char *file = CopFILE(cop);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would make more sense to just move up const char *file = CopFILE(cop); to come before PERL_ARGS_ASSERT_COP_FILE_AVN;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. When I now build with gcc-12, I can install Sereal::Decoder via cpan without build failures. Please review.

@Leont
Copy link
Contributor

Leont commented Jan 30, 2022

Fundamentally this is a policy decision. Are we ok with C99 leaking out in our headers or not?

Having done a little grepping I think we should not leak it for now.

Most of the issue is with dists using Module::Install:XSUtil, it's a gift that keeps on giving…

@tonycoz
Copy link
Contributor

tonycoz commented Jan 30, 2022

Perl now requires a C compiler that supports mixed declarations and code, upstream configures the compiler to not support that.

I think it should be fixed upstream.

WRT this patch, moving the declaration up means cop is dereferenced before it's asserted on, which is a minor regression (I expect there's similar problems in many other places though.)

@Leont
Copy link
Contributor

Leont commented Jan 30, 2022

Having done a little grepping I think we should not leak it for now.

On second thought, all the other dists only enable it as a warning. If Serial is the only thing declaring it an error, then we don't have much of an urgent issue.

@demerphq
Copy link
Collaborator

demerphq commented Jan 31, 2022 via email

@jkeenan
Copy link
Contributor Author

jkeenan commented Jan 31, 2022 via email

@demerphq
Copy link
Collaborator

demerphq commented Jan 31, 2022 via email

@xenu
Copy link
Member

xenu commented Jan 31, 2022

Why can't the policy be that headers have to stay old policy compliant?
The rest of the internals can follow the new policy.

I don't see the point in that. If perl was built using a C99 compiler, that means a C99 compiler can also be used for building modules.

@demerphq
Copy link
Collaborator

demerphq commented Jan 31, 2022 via email

@xenu
Copy link
Member

xenu commented Jan 31, 2022

I don't think it's reasonable to ban C99 (a 23 years old standard!) from headers forever because a very small number of modules uses compiler flags that ban them.

If a module author really needs to keep supporting hypothetical users stuck with ancient compilers, those flags should be either changed to warnings or restricted to a CI environment.

@nwc10
Copy link
Contributor

nwc10 commented Jan 31, 2022

For all CPAN it's only Sereal which faults this as an error, and Sereal/Sereal#265 was submitted last year to fix this. The other distributions which made it an error are updated. The rest are all warnings.

@demerphq
Copy link
Collaborator

demerphq commented Jan 31, 2022 via email

@demerphq
Copy link
Collaborator

demerphq commented Feb 7, 2022 via email

@jkeenan
Copy link
Contributor Author

jkeenan commented Feb 14, 2022

On 1/30/22 17:15, Tony Cook wrote: Perl now requires a C compiler that supports mixed declarations and code, upstream configures the compiler to not support that. I think it should be fixed upstream. WRT this patch, moving the declaration up means cop is dereferenced before it's asserted on, which is a minor regression (I expect there's similar problems in many other places though.)
Would my first commit -- which merely created a block in which the declaration was the first statement -- be desirable by itself?

@tonycoz, can I ask you to make an executive decision on this p.r.? What, if anything, should be committed to blead?

Thank you very much.
Jim Keenan

@hvds
Copy link
Contributor

hvds commented Mar 4, 2022

@tonycoz, can I ask you to make an executive decision on this p.r.? What, if anything, should be committed to blead?

I'm not Tony, but: blead is fine as is, nothing here should be committed. The only module for which the current code caused a problem has had a new version released so that it no longer causes a problem. I'd recommend withdrawing this PR.

@jkeenan jkeenan closed this Mar 5, 2022
@ailin-nemui
Copy link

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

Successfully merging this pull request may close these issues.

8 participants