[llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Gerolf Hoflehner via llvm-dev
Hi,

The argument list for cl::values in command line library should be end with null or clEnumValEnd. But the tutorial page(http://llvm.org/docs/CommandLine.html) doesn’t follow the rule, which would cause program crash during runtime.

I’d send a code review: https://reviews.llvm.org/D33861
Please cc other folks related to this part.

Best Regards,
Bekket McClane

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Gerolf Hoflehner via llvm-dev
Hi,

Can anyone help reviewing the code?
I think this revision is pretty important regarding that the command line library is also used in many non-LLVM projects.
It’s nice to provide a correct guideline to whom use the library for the first time.

B.R
McClane
Bekket McClane <[hidden email]> 於 2017年6月3日 下午9:00 寫道:

Hi,

The argument list for cl::values in command line library should be end with null or clEnumValEnd. But the tutorial page(http://llvm.org/docs/CommandLine.html) doesn’t follow the rule, which would cause program crash during runtime.

I’d send a code review: https://reviews.llvm.org/D33861
Please cc other folks related to this part.

Best Regards,
Bekket McClane


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Gerolf Hoflehner via llvm-dev
Hi Bekket,

  I don't see any use case in the codebase adding clEnumValEnd at the end of list (for example, [1]), I also don't see there is
clEnumValEnd. Do I miss something here?


Regards,
chenwj


2017-06-06 9:53 GMT+08:00 Bekket McClane via llvm-dev <[hidden email]>:
Hi,

Can anyone help reviewing the code?
I think this revision is pretty important regarding that the command line library is also used in many non-LLVM projects.
It’s nice to provide a correct guideline to whom use the library for the first time.

B.R
McClane
Bekket McClane <[hidden email]> 於 2017年6月3日 下午9:00 寫道:

Hi,

The argument list for cl::values in command line library should be end with null or clEnumValEnd. But the tutorial page(http://llvm.org/docs/CommandLine.html) doesn’t follow the rule, which would cause program crash during runtime.

I’d send a code review: https://reviews.llvm.org/D33861
Please cc other folks related to this part.

Best Regards,
Bekket McClane


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Gerolf Hoflehner via llvm-dev
Hi chenwj,

Thanks for you reminding, It turns out that the function prototype of cl::values had just changed between 4.x and the current trunk(5.x), and the current version is not null terminated anymore. 
(The online reference page http://llvm.org/docs/doxygen/html/CommandLine_8h.html is based on 4.x)
In another word, version of the tutorial page seems to be later than that of the reference page
I would close the issue later

Best Regards,
McClane
陳韋任 <[hidden email]> 於 2017年6月6日 下午9:15 寫道:

Hi Bekket,

  I don't see any use case in the codebase adding clEnumValEnd at the end of list (for example, [1]), I also don't see there is
clEnumValEnd. Do I miss something here?


Regards,
chenwj


2017-06-06 9:53 GMT+08:00 Bekket McClane via llvm-dev <[hidden email]>:
Hi,

Can anyone help reviewing the code?
I think this revision is pretty important regarding that the command line library is also used in many non-LLVM projects.
It’s nice to provide a correct guideline to whom use the library for the first time.

B.R
McClane
Bekket McClane <[hidden email]> 於 2017年6月3日 下午9:00 寫道:

Hi,

The argument list for cl::values in command line library should be end with null or clEnumValEnd. But the tutorial page(http://llvm.org/docs/CommandLine.html) doesn’t follow the rule, which would cause program crash during runtime.

I’d send a code review: https://reviews.llvm.org/D33861
Please cc other folks related to this part.

Best Regards,
Bekket McClane


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

Gerolf Hoflehner via llvm-dev

There used to be a ‘clEnumValEnd’ in LLVM v3.9, but it was removed when I updated to v4.0.  Is this being re-introduced in v5.0?

Thanks,

MartinO

 

From: llvm-dev [mailto:[hidden email]] On Behalf Of Bekket McClane via llvm-dev
Sent: 6 June 2017 15:07
To:
陳韋任 <[hidden email]>
Cc: LLVM Mailing List <[hidden email]>
Subject: Re: [llvm-dev] [CommandLine] Missing clEnumValEnd for cl::values in tutorial page

 

Hi chenwj,

 

Thanks for you reminding, It turns out that the function prototype of cl::values had just changed between 4.x and the current trunk(5.x), and the current version is not null terminated anymore. 

(The online reference page http://llvm.org/docs/doxygen/html/CommandLine_8h.html is based on 4.x)

In another word, version of the tutorial page seems to be later than that of the reference page

I would close the issue later

 

Best Regards,

McClane

陳韋任 <[hidden email]> 201766 下午9:15 寫道:

 

Hi Bekket,

 

  I don't see any use case in the codebase adding clEnumValEnd at the end of list (for example, [1]), I also don't see there is

clEnumValEnd. Do I miss something here?

 

 

Regards,

chenwj

 

 

2017-06-06 9:53 GMT+08:00 Bekket McClane via llvm-dev <[hidden email]>:

Hi,

 

Can anyone help reviewing the code?

I think this revision is pretty important regarding that the command line library is also used in many non-LLVM projects.

It’s nice to provide a correct guideline to whom use the library for the first time.

 

B.R

McClane

Bekket McClane <[hidden email]> 201763 下午9:00 寫道:

 

Hi,

 

The argument list for cl::values in command line library should be end with null or clEnumValEnd. But the tutorial page(http://llvm.org/docs/CommandLine.html) doesn’t follow the rule, which would cause program crash during runtime.

 

I’d send a code review: https://reviews.llvm.org/D33861

Please cc other folks related to this part.

 

Best Regards,

Bekket McClane

 


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



 

--

Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

 


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev