Re: [cfe-users] clang-format -style=file fails

2018-02-18 Thread Kim Gräsman via cfe-users
+list

On Sun, Feb 18, 2018 at 10:24 AM, Kim Gräsman  wrote:
> Hi Ray,
>
> I think clang-format searches for a ".clang-format" or "_clang-format"
> file by default, so you shouldn't need a -style argument.
>
> But if you do, it should probably say "-style=file" verbatim, to
> indicate that clang-format should search for a file.
>
> - Kim
>
> On Sat, Feb 17, 2018 at 10:14 PM, Ray Mitchell via cfe-users
>  wrote:
>> I'm trying to configure a custom style options file for clang-format v6.0.0
>> running on Windows 10 Pro 64-bit.  I started out by generating a
>> configuration file based upon the llvm style using the following command
>> line, which worked fine:
>> clang-format -style=llvm -dump-config > .clang-format
>>
>> The documentation for clang-format states the following:
>> "When the desired code formatting style is different from the available
>> options, the style can be customized using the -style="{key: value, ...}"
>> option or by putting your style configuration in the .clang-format or
>> _clang-format file in your project’s directory and using clang-format
>> -style=file."
>>
>> So just as a test I used the unchanged .clang-format file I generated above
>> and used the following command line:
>> clang-format -style=.clang-format Test.c
>> The result was a message that said "Invalid value for -style".  I then
>> changed the name of .clang-format to _clang-format and tried it again but
>> the result was the same.  So, my question is, "How do I specify a specific
>> style options file?"
>>
>> Thanks!
>> Ray
>>
>> ___
>> cfe-users mailing list
>> cfe-users@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>>
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] App security and the __FILE__ macro

2018-04-13 Thread Kim Gräsman via cfe-users
There's a patch waiting for attention here:
https://reviews.llvm.org/D17741

Looks like that would be great for you?

- Kim

On Fri, Apr 13, 2018 at 9:49 AM, Rick Mann via cfe-users
 wrote:
> No kidding! I know we use code similar to that. I’ll have to check when I’m 
> back at the computer.
>
> I also need to find a solution for Swift, but that’s another list.
>
> --
> Rick Mann
> rm...@latencyzero.com
>
>> On Apr 12, 2018, at 23:36, Duncan P. N. Exon Smith  
>> wrote:
>>
>> `strrchr(__FILE__, '/')+1` should get resolved at compile-time whenever you 
>> have optimizations on.
>>
>>> On Apr 12, 2018, at 15:38, Rick Mann via cfe-users 
>>>  wrote:
>>>
>>> The higher-ups decided we needed penetration testing of our app. One of 
>>> their concerns was that if you run the macOS strings tool on our binary and 
>>> grep for /Users, you get a ton of absolute paths for source files in the 
>>> project. This is because (I think) we use the __FILE__ macro as part of our 
>>> logging, to log file:line information. I find this info a boon, and we log 
>>> that even in release builds to help track down issues reported by 
>>> customers. At run time, we trim off all of the path except for the filename 
>>> and extension.
>>>
>>> It would be great if there were a __FILENAME__ macro that did this for me. 
>>> Is there any such thing?
>>>
>>> Thanks!
>>>
>>> --
>>> Rick Mann
>>> rm...@latencyzero.com
>>>
>>>
>>> ___
>>> cfe-users mailing list
>>> cfe-users@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>>
>
> ___
> cfe-users mailing list
> cfe-users@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] Question casually profiling Clang vs GCC

2018-08-03 Thread Kim Gräsman via cfe-users
Hi Florian,

Precompiled headers are supposed to live side-by-side with their
source headers, according to:
https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

So you can probably do something like `find /usr/include -name
"*.gch"` to see if there are GCC precompiled headers available.

(Not sure where you should be searching in Gentoo to catch all
headers, but you should be able to figure it out)

Cheers,
- Kim

On Wed, Aug 1, 2018 at 11:28 PM, Florian Berger via cfe-users
 wrote:
> On 01.08.2018 16:29, Jonas Toth via cfe-users wrote:
>>
>> very interesting. My experience with normal compilation is, that clang
>> is faster.
>
> Here's the data. It's from a single run each, so it's nowhere near a
> statistically sound sample.
>
> Package  GCC Clang   Difference
>
> dev-lang/python-2.7.152:31,640s   3:36,891s  +43%
> app-arch/unzip-6.0_p21-r2 0:07,859s   0:10,094s  +28%
> media-libs/opus-1.2.1 0:34,218s   0:46,750s  +37%
> mail-mta/exim-4.91-r2 0:39,779s   0:54,672s  +37%
> www-servers/nginx-1.12.2-r1   0:43,378s   1:03,537s  +46%
> dev-db/postgresql-10.34:03,518s   6:14,859s  +54%
> media-gfx/inkscape-0.92.228:21,146s  34:52,015s  +23%
>
>
>> Could it be, that there are some precompiled headers or similar present
>> on the system, that GCC utilizes?
>
> That is possible. Where and how would I check that?
>
> Cheers,
> Florian
>
>
> ___
> cfe-users mailing list
> cfe-users@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users